mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-03-29 04:23:34 +01:00
Optimized animation for menu
This commit is contained in:
parent
5677a91e82
commit
e005ced3d4
@ -1,5 +1,4 @@
|
|||||||
Overview
|
.. markdown-include:: README.md
|
||||||
===========================================================
|
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
@ -2,10 +2,3 @@ Applications and Roles
|
|||||||
===========================================================
|
===========================================================
|
||||||
|
|
||||||
.. markdown-include:: README.md
|
.. markdown-include:: README.md
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
:maxdepth: 1
|
|
||||||
:caption: About CyMaIS:
|
|
||||||
:glob:
|
|
||||||
|
|
||||||
*.rst
|
|
||||||
|
@ -1,31 +1,44 @@
|
|||||||
{% macro render_headings(headings) %}
|
{% macro render_headings(headings, level=1) %}
|
||||||
<ul>
|
<ul class="toctree-l{{ level }}">
|
||||||
{% for item in headings %}
|
{% for item in headings %}
|
||||||
<li>
|
<li class="toctree-l{{ level }}{% if item.current %} current{% endif %}"
|
||||||
<a href="{{ pathto(item.link).replace("#", "") + '#' + item.anchor }}">{{ item.text }}</a>
|
{% if item.children %} x-data="{ expanded: false }" {% endif %}>
|
||||||
|
<a class="reference internal{% if item.children %} expandable{% endif %}"
|
||||||
|
href="{{ pathto(item.link).replace('#', '') }}{% if item.anchor %}#{{ item.anchor }}{% endif %}"
|
||||||
|
{% if item.children %}
|
||||||
|
@click.prevent="expanded = !expanded"
|
||||||
|
:class="{ 'expanded': expanded }"
|
||||||
|
{% endif %}>
|
||||||
|
{{ item.text }}
|
||||||
|
{% if item.children %}
|
||||||
|
<button @click.prevent.stop="expanded = !expanded" type="button" class="toggle-button" style="background: none; border: none; padding: 0; margin-left: 5px;">
|
||||||
|
<span x-show="!expanded">
|
||||||
|
<svg fill="currentColor" height="18px" stroke="none" viewBox="0 0 24 24" width="18px" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"></path>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<span x-show="expanded">▼</span>
|
||||||
|
</button>
|
||||||
|
{% endif %}
|
||||||
|
</a>
|
||||||
{% if item.children %}
|
{% if item.children %}
|
||||||
{{ render_headings(item.children) }}
|
<ul x-show="expanded" class="toctree-l{{ level + 1 }}">
|
||||||
|
{{ render_headings(item.children, level+1) }}
|
||||||
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% if local_md_headings %}
|
{% if local_md_headings or local_subfolders %}
|
||||||
<div class="local-md-headings">
|
<div class="local-md-headings">
|
||||||
<h3>Current Folder</h3>
|
<h3 class="toctree-l1">Index</h3>
|
||||||
{{ render_headings(local_md_headings) }}
|
{% if local_subfolders %}
|
||||||
|
{{ render_headings(local_subfolders) }}
|
||||||
|
{% endif %}
|
||||||
|
{% if local_md_headings %}
|
||||||
|
{{ render_headings(local_md_headings) }}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if local_subfolders %}
|
|
||||||
<div class="local-subfolders">
|
|
||||||
<h3>Subfolders</h3>
|
|
||||||
<ul>
|
|
||||||
{% for item in local_subfolders %}
|
|
||||||
<li><a href="{{ pathto(item.link) }}">{{ item.text }}</a></li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user