Closed rauschma closed 5 months ago
Ignore my first response, you don't want to replace our parser - you want to replace the emitter itself.
The __emitter
API (using our parser, but replacing our emitter) is a private (yet quite stable) API. As it's private [ie, unsupported] I can't offer real support, but if you want to learn about it I'd suggest:
TokenTreeEmitter
in the sourcelowlight
source carefully (as it uses this same private API)Thanks! (And thanks for Highlight.js in general – the library, its website and its complementary tools are a joy to use.)
In case you are interested – this is how I use Highlight.js to produce PDFs with syntax-highlighted code: https://fosstodon.org/@rauschma/111800543890963559
Is your request related to a specific problem you're having?\ I’m using Highlight.js to syntax-highlight code for LaTeX documents. I tried but failed to use the Emitter API.
The solution you'd prefer / feature you'd like to see added...\ I created a repository that would be enough documentation (if it worked...): [repository deleted]
Any alternative solutions you considered...\ My current workaround is to use package
lowlight
. But I don’t need the intermediate tree it creates; the Emitter API itself would be enough.