Skip to content

Commit

Permalink
Move directivesRemovedFromContent to BlockDirective
Browse files Browse the repository at this point in the history
While looking at swiftlang#982, I found that there's a better place to keep the list of directive names which we consider removed from content -- we already had a file with lists of directive names so it'll be clearer to keep all of them in the same file.
  • Loading branch information
anferbui committed Jul 11, 2024
1 parent 563b958 commit f01009f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/SwiftDocC/Model/DocumentationMarkup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ struct DocumentationMarkup {
// Found deprecation notice in the abstract.
deprecation = MarkupContainer(directive.children)
return
} else if Self.directivesRemovedFromContent.contains(directive.name) {
} else if BlockDirective.directivesRemovedFromContent.contains(directive.name) {
// These directives don't affect content so they shouldn't break us out of
// the automatic abstract section.
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,11 @@ extension BlockDirective {
Volume.directiveName,
XcodeRequirement.directiveName
]

static let directivesRemovedFromContent: [String] = [
Comment.directiveName,
Metadata.directiveName,
Options.directiveName,
Redirect.directiveName,
]
}

0 comments on commit f01009f

Please sign in to comment.