{%- macro admonition(title, theme, icon) -%}
{{ title }}: {%- endmacro -%} {%- set content = page.content | trim -%} {#- Remove trailing slash on void elements -#} {%- set content = content | replace('" />', '">') -%} {#- Open external links in new tab -#} {%- set content = content | replace('Q-CTRL') -%} {#- Convert header links -#} {%- set content = content | replace('¶', '#') -%} {#- Convert code blocks This is necessary because we use fenced code blocks to also define Mermaid diagrams, so we need to turn this:
...
into this:
...so we're going to start by coverting this:
...
to this:
...This is a hack and breaks semantics but it's the best zero-config solution we have at this point to support both syntax highlighting and Mermaid diagrams. -#} {%- set content = content | replace('
', '') -%}
{%- set content = content | replace('', '') -%}
{#- Convert admonitions -#}
{%- set content = content | replace('Abstract:', admonition('Abstract', 'info', 'clipboard-fill')) -%}
{%- set content = content | replace('
Bug:', admonition('Bug', 'danger', 'bug-fill')) -%}
{%- set content = content | replace('
Danger:', admonition('Danger', 'danger', 'lightning-fill')) -%}
{%- set content = content | replace('
Error:', admonition('Error', 'danger', 'x-circle-fill')) -%}
{%- set content = content | replace('
Example:', admonition('Example', 'info', 'flask-fill')) -%}
{%- set content = content | replace('
Failure:', admonition('Failure', 'danger', 'x-circle-fill')) -%}
{%- set content = content | replace('
Important:', admonition('Important', 'warning', 'exclamation-circle-fill')) -%}
{%- set content = content | replace('
Info:', admonition('Info', 'info', 'info-circle-fill')) -%}
{%- set content = content | replace('
Note:', admonition('Note', 'info', 'pencil-fill')) -%}
{%- set content = content | replace('
Question:', admonition('Question', 'info', 'question-circle-fill')) -%}
{%- set content = content | replace('
Success:', admonition('Success', 'success', 'check-circle-fill')) -%}
{%- set content = content | replace('
Tip:', admonition('Tip', 'info', 'fire')) -%}
{%- set content = content | replace('
To-do:', admonition('To-do', 'warning', 'check-square-fill')) -%}
{%- set content = content | replace('
Warning:', admonition('Warning', 'warning', 'exclamation-triangle-fill')) -%}
{#- Make tables responsive -#}
{%- set content = content | replace('