You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't enforce unique filenames for documentation extensions (#863)
* Allow documentation extensions to have the same name
Since documentation extensions' filenames have no impact on the URL of any pages, there's no need to enforce unique filenames for them.
DocC currently uses only the filename / last path component of articles to determine if there is a duplicate article. This change excludes doc extensions from that check to allow documentation extensions to have the same filename.
rdar://117174884
* Add test to ensure doc extensions can have the same filename
Checks that doc extensions with the same filename do not produce a warning and DocC no longer drops the content from one of the files.
// Separate articles that look like documentation extension files from other articles, so that the documentation extension files can be matched up with a symbol.
910
-
// At this point we consider all articles with an H1 containing link "documentation extension" - some links might not resolve in the final documentation hierarchy
911
-
// and we will emit warnings for those later on when we finalize the bundle discovery phase.
912
-
if result.value.title?.child(at:0) is AnyLink{
916
+
// Some links might not resolve in the final documentation hierarchy and we will emit warnings for those later on when we finalize the bundle discovery phase.
917
+
if isDocumentationExtension {
913
918
documentationExtensions.append(result)
914
919
915
920
// Warn for an incorrect root page metadata directive.
XCTAssertEqual(someEnumSymbol.abstract?.plainText,"A documentation extension for my enum.","The abstract should be from the symbol's documentation extension.")
XCTAssertEqual(anotherEnumSymbol.abstract?.plainText,"A documentation extension for an unrelated enum.","The abstract should be from the symbol's documentation extension.")
0 commit comments