Skip to content

Include user provided theme-settings.json file in compiled output #339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

mportiz08
Copy link
Contributor

Bug/issue #, if applicable: #336

Summary

If a documentation catalog contains a theme-settings.json file, DocC will now include this file in the compiled output, alongside the JSON data and static renderer assets.

If a default theme-settings.json file is already provided by the renderer, the file provided by the catalog will take precedence.

This is the minimal DocC implementation work needed to support the proposal described in the Customizing the look and feel of Swift-DocC-Render forum post.

Dependencies

There are no explicit dependencies for this PR since DocC-Render already has some (minimal) support for the presence of this file in the output, however future PRs for DocC-Render will enhance these capabilities and document the supported settings.

Testing

Steps:

  1. Download/unzip with-settings.diff.zip
  2. Run cd swift-docc; git apply with-settings.patch
  3. Run env DOCC_HTML_DIR=$(dirname $(xcrun --find docc))/../share/docc/render bin/preview-docs DocC¹
  4. Open http://localhost:8000/documentation/docc and verify that some of the text on the page is now green

¹ this env var value will only work if you have a recent Xcode installed, however you can substitute it with a built copy of the renderer in other ways if needed

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 (note: documentation for the JSON file itself will be added in a later PR here or in swift-docc-render)

@mportiz08 mportiz08 requested a review from franklinsch July 19, 2022 22:07
@mportiz08 mportiz08 linked an issue Jul 20, 2022 that may be closed by this pull request
Copy link
Contributor

@franklinsch franklinsch left a comment

Choose a reason for hiding this comment

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

Nice testing!

@mportiz08
Copy link
Contributor Author

@swift-ci test

@mportiz08 mportiz08 merged commit 10994be into swiftlang:main Jul 20, 2022
@mportiz08 mportiz08 deleted the add-support-for-theme-settings-file branch July 20, 2022 18:03
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.

Include user provided theme-settings.json file in compiled output
2 participants