First-class support for adding custom scripts to a DocC-generated website. These may be local scripts, in which case the website will continue to work offline, or they may be external scripts at a user-specified URL. This support is in the form of a custom-scripts.json file, the scripting analog of theme-settings.json.
To test the feature end-to-end, you'll need to use the version of swift-docc with the corresponding changes. Follow the steps in the pitch for adding any custom scripts you want to your documentation website (your own scripts, or a library such as MathJax or D2). If you want a specific example to test the implementation:
Copy the custom-scripts.json and the custom mathjax-config.js script (shown in the pitch) to your documentation catalog.
Add LaTeX expressions to your in-source documentation.
docc convert the documentation catalog with your custom scripts. Observe that the modified swift-docc copied custom-scripts.json and the custom scripts into the documentation archive.
Preview the documentation archive. Observe that the LaTeX expressions are rendered on the page.
Summary
First-class support for adding custom scripts to a DocC-generated website. These may be local scripts, in which case the website will continue to work offline, or they may be external scripts at a user-specified URL. This support is in the form of a
custom-scripts.json
file, the scripting analog oftheme-settings.json
.Full pitch: https://forums.swift.org/t/pitch-support-for-custom-scripts-in-docc/75357.
Dependencies
Corresponding change in swift-docc.
Testing
custom-scripts.json
and the custommathjax-config.js
script (shown in the pitch) to your documentation catalog.docc convert
the documentation catalog with your custom scripts. Observe that the modified swift-docc copiedcustom-scripts.json
and the custom scripts into the documentation archive.Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
npm test
, and it succeeded