Documenter.jl icon indicating copy to clipboard operation
Documenter.jl copied to clipboard

Support for external parsers like CommonMark

Open kbarros opened this issue 1 year ago • 2 comments

It has been hinted in various comments that support is planned for external markdown parsers (e.g., here, here, and here). There is an old branch exploring it. I would love this feature! ❤️

My personal use case would be writing very math heavy documentation (e.g., https://sunnysuite.github.io/Sunny.jl/dev/structure-factor.html). It would be a huge boon to be able to use the $ and $$ syntax to get inline Latex, which would unlock the "live preview" feature available in editors like VSCode. That transforms the writing experience.

kbarros avatar Jun 02 '24 22:06 kbarros

Yep, good to have a dedicated issue. The interface should, basically, be that you provide MarkdownAST AST data structure as a page. CommonMark could potentially be special cased though, so that you could just swap out the default parser for all .md files (probably done via a Pkg extension initially?). But there's also value in being able to override the parser for single files (e.g. to proprely parse READMEs).

mortenpi avatar Jun 02 '24 23:06 mortenpi

Some additional setup work seems fine. To make sure I understand, the feature would enable, say, CommonMark parsing (the Latex $$ for example), while also allowing for things like Documenter hyperrefs using, e.g., [`foo`](@ref)?

kbarros avatar Jun 06 '24 00:06 kbarros