Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions markdown.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -37717,17 +37717,42 @@ end
% \begin{markdown}
%
% Typeset fenced code with infostring `mermaid` using the command `mmdc` from
% the npm package `@mermaid-js/mermaid-cli`.
% the npm package `@mermaid-js/mermaid-cli`. The exact command can be
% configured by redefining or appending to the
% \mdef{g_@@_diagrams_mmdc_command_tl} token list or by redefining the
% \mdef{mmdcCommand} macro. Unlike the token list, the macro can be redefined
% even before loading the Markdown package.
%
% \end{markdown}
% \begin{macrocode}
\tl_new:N
\g_@@_diagrams_mmdc_command_tl
\tl_gset:Nn
\g_@@_diagrams_mmdc_command_tl
{ mmdc }
\cs_if_free:NT
\mmdcCommand
{
\cs_new:Npn
\mmdcCommand
{
\tl_use:N
\g_@@_diagrams_mmdc_command_tl
}
}
\cs_set:Nn
\@@_diagrams_infostrings_current:n
{
\@@_diagrams_render_diagram:nnnn
\tl_set:Nx
\l_tmpb_tl
{ \mmdcCommand }
\tl_put_right:Nn
\l_tmpb_tl
{ ~--pdfFit~-i~#1~-o~#1.pdf }
\@@_diagrams_render_diagram:nnVn
{ #1 }
{ #1.pdf }
{ mmdc~--pdfFit~-i~#1~-o~#1.pdf }
\l_tmpb_tl
{ Mermaid~image }
}
\@@_tl_set_from_cs:NNn
Expand Down