Correctly strip ".docc" extension for display name - #1679
Merged
Merged
Conversation
When a documentation catalog is passed to `docc convert` as "." or "./", DocC derives the bundle's asset folder name from the resolved directory name without stripping the ".docc" path extension. Media assets in the built archive then land under a directory with this extension, e.g. `images/Foo.docc/` instead of `images/Foo/`. The reference URLs inside the rendered page JSON are rewritten to match, so the archive is internally consistent and renders correctly, but this is inconsistent with how catalogs are processed when their absolute path is provided. Resolve "." and ".." paths when computing the derived display name. rdar://185831691
d-ronnqvist
approved these changes
Oct 1, 2026
Contributor
Author
|
@swift-ci test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug/issue #, if applicable: rdar://185831691
Summary
When a documentation catalog is passed to
docc convertas "." or "./", DocC derives the bundle's asset folder name from the resolved directory name without stripping the ".docc" path extension. Media assets in the built archive then land under a directory with this extension, e.g.images/Foo.docc/instead ofimages/Foo/. The reference URLs inside the rendered page JSON are rewritten to match, so the archive is internally consistent and renders correctly, but this is inconsistent with how catalogs are processed when their absolute path is provided. Resolve "." and ".." paths when computing the derived display name.Dependencies
N/A
Testing
Call
docc convert .from inside a catalog with images, and inspect theimages/directory in the output.Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/testscript and it succeeded