Skip to content

Conversation

@d-ronnqvist
Copy link
Contributor

@d-ronnqvist d-ronnqvist commented Dec 15, 2025

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

Summary

This is the last piece of #1366.

It adds a new --experimental-transform-for-static-hosting-with-content flag that enables DocC's feature to supplement the output with minimal content I the per-page "index.html" files.

It also improves the robustness of the modifications of the "index.html" files (in 8e996c4) — even though this is more a theoretical issue since the DocC Render templates have had the same structure for as long as the project has existed.

It also adds support for mixing this experimental feature with the --experimental-enable-custom-templates flag (in 4910bf9).

Lastly, it adds an entry to the "features.json" file so that tools can check if DocC supports this feature before passing the flag.

Dependencies

None.

Testing

from #1366:

  • Build documentation for some project and pass the --experimental-transform-for-static-hosting-with-content flag
  • Start a basic web server from within the documentation archive, for example ruby -run -ehttpd . -p8000.
    Note: the later steps won't work with docc prevew
  • Browse the local documentation.
    • Everything should look and work the same as today
  • Disable JavaScript in your web browser
  • Refresh the currently open documentation page
    • You should see a very plain version the content, without most of the styling and layout
  • Click though links in the content, curation, and breadcrumbs
    • You should be taken to the page that you clicked on
  • Navigate to one of the index.html files in the file system and open (it by double clicking).
    Alternatively, on macOS you can run open /path/to/SomeModule.doccarchive/documentation/somemodule/index.html
    • You should see a completely plain version the content, without any of the styling and layout
  • Click though links in the content, curation, and breadcrumbs
    • You should be taken to the page that you clicked on

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

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@anferbui anferbui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly got some questions, but overall looking good.

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist d-ronnqvist requested a review from anferbui December 18, 2025 13:15
Copy link
Contributor

@anferbui anferbui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, up to you whether you address the nit or not!

TextFile(name: "RootArticle.md", utf8Content: """
# A single article

This is an _formatted_ article that becomes the root page (because there is only one page).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This test also has the same typo, but up to you if you'd like to fix it!

Suggested change
This is an _formatted_ article that becomes the root page (because there is only one page).
This is a _formatted_ article that becomes the root page (because there is only one page).

@d-ronnqvist
Copy link
Contributor Author

LGTM, up to you whether you address the nit or not!

I can fix it. I just need to update the test expectation to match.

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist d-ronnqvist merged commit b21d94f into swiftlang:main Dec 18, 2025
2 checks passed
@d-ronnqvist d-ronnqvist deleted the output-html-integrate-3 branch December 18, 2025 13:51
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