Skip to content

Commit 24ba4b7

Browse files
authored
[Hold] Enable hierarchy-based link resolver implementation by default (#498)
* Enable the hierarchy based link resolver implementation by default rdar://98692937 * Remove redundant symbol link disambiguation * Correct outdated symbol links * Remove symbol curation for non-existing symbols
1 parent 72020de commit 24ba4b7

File tree

13 files changed

+26
-21
lines changed

13 files changed

+26
-21
lines changed

Sources/SwiftDocC/Coverage/DocumentationCoverageOptions.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ extension DocumentationCoverageOptions.KindFilterOptions {
149149
self.init(rawValue: mask)
150150
}
151151

152-
/// Represents a single kind option. ``DocumentationCoverageOptions/KindFilterOptions-swift.struct``
152+
/// Represents a single kind option. ``DocumentationCoverageOptions/KindFilterOptions``
153153
/// cannot enforce the restriction that it only represents one
154154
/// option when necessary so this type is preferred in when representing individual kinds that can be represented.
155155
public enum BitFlagRepresentation: CaseIterable {

Sources/SwiftDocC/DocumentationService/Models/Services/Convert/ConvertRequest.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public struct ConvertRequest: Codable {
1616
/// Information about the documentation bundle to convert.
1717
///
1818
/// ## See Also
19-
/// - ``DocumentationBundle/Info-swift.struct``
19+
/// - ``DocumentationBundle/Info``
2020
public var bundleInfo: DocumentationBundle.Info
2121

2222
/// Feature flags to enable when performing this convert request.

Sources/SwiftDocC/Infrastructure/Link Resolution/LinkResolutionMigration.swift

+10-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,16 @@ enum LinkResolutionMigrationConfiguration {
2121

2222
/// Whether or not the context should the a ``PathHierarchyBasedLinkResolver`` to resolve links.
2323
static var shouldUseHierarchyBasedLinkResolver: Bool = {
24-
return UserDefaults.standard.bool(forKey: "DocCUseHierarchyBasedLinkResolver")
25-
|| ProcessInfo.processInfo.environment["DOCC_USE_HIERARCHY_BASED_LINK_RESOLVER"] == "YES"
24+
let defaultsKey = "DocCUseHierarchyBasedLinkResolver"
25+
let environmentKey = "DOCC_USE_HIERARCHY_BASED_LINK_RESOLVER"
26+
27+
if UserDefaults.standard.object(forKey: defaultsKey) != nil {
28+
return UserDefaults.standard.bool(forKey: defaultsKey)
29+
}
30+
if let environmentValue = ProcessInfo.processInfo.environment[environmentKey] {
31+
return environmentValue == "NO"
32+
}
33+
return true
2634
}()
2735

2836
/// Whether or not the context should report differences between the disambiguated paths created by ``PathHierarchyBasedLinkResolver`` and ``DocumentationCacheBasedLinkResolver``.

Sources/SwiftDocC/LinkTargets/LinkDestinationSummary.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ import SymbolKit
6969
///
7070
/// Various information from the summary is used depending on what content references the summarized element. For example:
7171
/// - In a paragraph of text, a link to this element will use the ``title`` as the link text and style the tile in code font if the ``kind`` is a type of symbol.
72-
/// - In a task group, the the ``title`` and ``abstract-swift.property`` is displayed together to give more context about this element and the element may be marked as deprecated
72+
/// - In a task group, the the ``title`` and ``abstract`` is displayed together to give more context about this element and the element may be marked as deprecated
7373
/// based on the values of its ``platforms`` and other metadata about the current versions of the platforms.
7474
///
7575
/// The summary may include content that vary based on the source language. The content that is different in another source language is specified in a ``Variant``. Any property on the variant that is `nil` has the same value as the summarized element's value.
@@ -150,7 +150,7 @@ public struct LinkDestinationSummary: Codable, Equatable {
150150

151151
/// References used in the content of the summarized element.
152152
///
153-
/// This includes the element's ``topicImages`` or references from the element's ``abstract-swift.property``.
153+
/// This includes the element's ``topicImages`` or references from the element's ``abstract``.
154154
/// This also includes any references for all variants' content.
155155
public var references: [RenderReference]?
156156

Sources/SwiftDocC/Model/Rendering/Content/RenderBlockContent.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ import Markdown
3030
/// [ Paragraph ... ]
3131
/// ```
3232
///
33-
/// `RenderBlockContent` contains traditional elements like ``paragraph(inlineContent:)`` and
34-
/// ``heading(level:text:anchor:)`` but also other documentation-specific elements like
35-
/// ``step(content:caption:media:code:runtimePreview:)`` and ``endpointExample(summary:request:response:)``.
33+
/// `RenderBlockContent` contains traditional elements like ``paragraph(_:)`` and
34+
/// ``heading(_:)`` but also other documentation-specific elements like
35+
/// ``step(_:)`` and ``endpointExample(_:)``.
3636
///
3737
/// Block elements can be nested, for example, an aside note contains one or more paragraphs of text.
3838
public enum RenderBlockContent: Equatable {

Sources/SwiftDocC/Model/Rendering/RenderNode.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import Foundation
4747
/// ### General
4848
///
4949
/// - ``schemaVersion``
50-
/// - ``kind-swift.property``
50+
/// - ``kind``
5151
/// - ``sections``
5252
/// - ``references``
5353
/// - ``hierarchy``

Sources/SwiftDocC/Semantics/Metadata/CallToAction.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public final class CallToAction: Semantic, AutomaticDirectiveConvertible {
7878
]
7979

8080
/// The computed label for this Call to Action, whether provided directly via ``label`` or
81-
/// indirectly via ``purpose-swift.property``.
81+
/// indirectly via ``purpose``.
8282
public var buttonLabel: String {
8383
if let label = label {
8484
return label

Sources/SwiftDocC/Semantics/Metadata/DisplayName.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import Markdown
1515
///
1616
/// The ``name`` property will override the symbol's default display name.
1717
///
18-
/// When the ``style-swift.property`` property is ``Style-swift.enum/conceptual``, the symbol's name is rendered as "conceptual"—same as article names or tutorial names —where applicable. The default style is ``Style-swift.enum/conceptual``.
18+
/// When the ``style`` property is ``Style/conceptual``, the symbol's name is rendered as "conceptual"—same as article names or tutorial names —where applicable. The default style is ``Style/conceptual``.
1919
///
20-
/// When the ``style-swift.property`` property is ``Style-swift.enum/symbol``, the symbol's name is rendered as "symbol"—same as article names or tutorial names —where applicable. The default style is ``Style-swift.enum/conceptual``.
20+
/// When the ``style`` property is ``Style/symbol``, the symbol's name is rendered as "symbol"—same as article names or tutorial names —where applicable. The default style is ``Style/conceptual``.
2121
///
2222
/// This directive is only valid within a ``Metadata`` directive:
2323
/// ```
@@ -34,7 +34,7 @@ public final class DisplayName: Semantic, AutomaticDirectiveConvertible {
3434

3535
/// The style of the display name for this symbol.
3636
///
37-
/// Defaults to ``Style-swift.enum/conceptual``.
37+
/// Defaults to ``Style/conceptual``.
3838
@DirectiveArgumentWrapped
3939
public var style: Style = .conceptual
4040

Sources/SwiftDocC/Semantics/Metadata/DocumentationExtension.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import Markdown
1313

1414
/// A directive that controls how the documentation-extension file merges with or overrides the in-source documentation.
1515
///
16-
/// When the ``behavior-swift.property`` property is ``Behavior-swift.enum/append``, the content from the documentation-extension file is added after the content from
16+
/// When the ``behavior`` property is ``Behavior/append``, the content from the documentation-extension file is added after the content from
1717
/// the in-source documentation for that symbol.
18-
/// If a documentation-extension file doesn't have a `DocumentationExtension` directive, then it has the ``Behavior-swift.enum/append`` behavior.
18+
/// If a documentation-extension file doesn't have a `DocumentationExtension` directive, then it has the ``Behavior/append`` behavior.
1919
///
20-
/// When the ``behavior-swift.property`` property is ``Behavior-swift.enum/override``, the content from the documentation-extension file completely replaces the content
20+
/// When the ``behavior`` property is ``Behavior/override``, the content from the documentation-extension file completely replaces the content
2121
/// from the in-source documentation for that symbol
2222
///
2323
/// This directive is only valid within a ``Metadata`` directive:

Sources/SwiftDocC/Semantics/Symbol/PlatformName.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public struct PlatformName: Codable, Hashable, Equatable {
104104

105105
/// Creates a new platform name from the given metadata availability attribute platform.
106106
///
107-
/// Returns `nil` if the given platform was ``Metadata/Availability/Platform-swift.enum/any``.
107+
/// Returns `nil` if the given platform was ``Metadata/Availability/Platform/any``.
108108
init?(metadataPlatform platform: Metadata.Availability.Platform) {
109109
// Note: This is still an optional initializer to prevent source breakage when
110110
// `Availability.Platform` re-introduces the `.any` case

Sources/SwiftDocC/Semantics/Symbol/Symbol.swift

-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ import SymbolKit
8686
/// - ``redirects``
8787
/// - ``returnsSection``
8888
/// - ``parametersSection``
89-
/// - ``dictionaryKeysSection``
9089
/// - ``abstract``
9190
/// - ``isDeprecated``
9291
/// - ``isSPI``

Sources/SwiftDocC/SwiftDocC.docc/SwiftDocC/StaticAnalysis.md

-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ Run static analysis checks on markup files.
1919
- ``NonInclusiveLanguageChecker``
2020
- ``NonOverviewHeadingChecker``
2121
- ``SeeAlsoInTopicsHeadingChecker``
22-
- ``TopicsSectionWithoutSubheading``
2322

2423
<!-- Copyright (c) 2021 Apple Inc and the Swift Project authors. All Rights Reserved. -->

Sources/SwiftDocCUtilities/SwiftDocCUtilities.docc/SwiftDocCUtilities/Extensions/Docc.md

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
- ``DocCArchiveOption``
1212
- ``DocumentationBundleOption``
1313
- ``OutOfProcessLinkResolverOption``
14-
- ``PreviewExternalConnectionOptions``
1514
- ``TemplateOption``
1615

1716
<!-- Copyright (c) 2021 Apple Inc and the Swift Project authors. All Rights Reserved. -->

0 commit comments

Comments
 (0)