Skip to content

Correctly strip ".docc" extension for display name - #1679

Merged
snprajwal merged 2 commits into
swiftlang:mainfrom
snprajwal:fix-dir
Oct 1, 2026
Merged

snprajwal merged 2 commits into
swiftlang:mainfrom
snprajwal:fix-dir

Conversation

@snprajwal

Copy link
Copy Markdown
Contributor

Bug/issue #, if applicable: rdar://185831691

Summary

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.

Dependencies

N/A

Testing

Call docc convert . from inside a catalog with images, and inspect the images/ directory in the output.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary

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
@snprajwal
snprajwal requested a review from a team as a code owner September 30, 2026 17:18
@snprajwal

Copy link
Copy Markdown
Contributor Author

@swift-ci test

@snprajwal
snprajwal enabled auto-merge (squash) October 1, 2026 10:05
@snprajwal
snprajwal merged commit ae6f422 into swiftlang:main Oct 1, 2026
42 checks passed
@snprajwal
snprajwal deleted the fix-dir branch October 1, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants