Replies: 2 comments
-
Thanks for sharing. Highlighting definitely needs some work. However, I'm not sure if we want to add an API-based approach to highlighting. We're trying quite the opposite, to build a solution that is as self-contained as possible, so it also works offline. |
Beta Was this translation helpful? Give feedback.
-
The resulting highlighted content is available offline, but I totally understand the position on 3rd party APIs. This can at least serve as a resource for others that might be searching for this topic. It's easy enough to do as an additional build step. First, disable using pygments during the mkdocs build step: markdown_extensions:
- pymdownx.highlight:
use_pygments: false This keeps our code blocks intact with a class to define the language (that still works for Torchlight). Next, install the Torchlight CLI client inside your docs folder, following the Torchlight docs, and then setup the include globs to process files in the output folder you have setup in mkdocs (for me it looks like this): includeGlobs: [
'site/**/*.htm',
'site/**/*.html'
], Then, build your docs as usual, and follow that up by running Torchlight. mkdocs build
npx torchlight |
Beta Was this translation helpful? Give feedback.
-
Torchlight is a new, VS Code powered syntax highlighter, see here: https://torchlight.dev/
Would be very great to have support for this as it does a much better job at highlighting than any existing tools.
Understandably since it's API based and not open-source, I think it might be out of scope. Thought I'd mention the idea regardless, and for anyone looking to use it in the future.
Beta Was this translation helpful? Give feedback.
All reactions