Sha256: 2b2bb1646c2dbd3e8a65f950675afbffdc2ab05530b65a0f599409bd4fa949ef

Contents?: true

Size: 1.27 KB

Versions: 3

Compression:

Stored size: 1.27 KB

Contents

{%- assign blocks = content | split: "<pre" -%}
{%- for block in blocks -%}
    {%- assign child_blocks = block | split: "</pre>" %}
    {%- if child_blocks.size == 1 -%}
        {{ block }}
    {%- else -%}
        {%- comment %} admonitions card {% endcomment -%}
        {%- assign admonitions = "note, tip, warning, danger" | split: ", " -%}
        {%- comment %} get pre code and type {% endcomment -%}
        {%- assign pre_blocks = child_blocks.first | replace_first: ">", "```<temp>```" | split: "```<temp>```" -%}
        {%- assign pre_type = pre_blocks.first | replace: '"', '' | replace: " class=notranslate language-", ""  -%}

        {%- if admonitions contains pre_type -%}
            <div class="admonition {{ pre_type }}">
                {%- comment %} title will be translated via ui {% endcomment -%}
                <p class="admonition-title" ui="{{ pre_type }}"><span class="progress"></span></p>{{ pre_blocks.last | markdownify | strip_newlines -}}
            </div>{{ child_blocks.last -}}
        {%- elsif pre_type == "mermaid" -%}
            <div class="mermaid">{{ pre_blocks.last }}</div>{{ child_blocks.last }}
        {%- else -%}
            <pre{{ child_blocks.first }}</pre> {{ child_blocks.last -}}
        {%- endif -%}
    {%- endif -%}
{%- endfor -%}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jekyll-rtd-theme-1.1.7 _layouts/plugins/extension.liquid
jekyll-rtd-theme-1.1.6 _layouts/plugins/extension.liquid
jekyll-rtd-theme-1.1.5 _layouts/plugins/extension.liquid