{% component tree() %}
{% set lines = body | split(pat="\n") %} {% set_global current_depth = 0 %} {% for raw_line in lines %} {% set line_trim = raw_line | trim %} {% if line_trim | length > 0 %} {% set comment = "" %} {% set line_clean = raw_line %} {% if raw_line is containing(pat="//") %} {% set parts = raw_line | split(pat="//") %} {% set line_clean = parts[0] %} {% set comment = parts[1] | trim %} {% elif raw_line is containing(pat="#") %} {% set parts = raw_line | split(pat="#") %} {% set line_clean = parts[0] %} {% set comment = parts[1] | trim %} {% endif %} {% set norm = line_clean | replace(from="├── ", to=" ") | replace(from="└── ", to=" ") | replace(from="│ ", to=" ") | replace(from="│ ", to=" ") %} {% set depth = 0 %} {% if norm is starting_with(pat=" ") %}{% set depth = 4 %} {% elif norm is starting_with(pat=" ") %}{% set depth = 3 %} {% elif norm is starting_with(pat=" ") %}{% set depth = 2 %} {% elif norm is starting_with(pat=" ") %}{% set depth = 1 %} {% endif %} {% set item_name = norm | trim %} {% if item_name | length > 0 %} {% set is_dir = false %} {% if item_name is ending_with(pat="/") or item_name is ending_with(pat="\\") %} {% set is_dir = true %} {% endif %} {% set clean_name = item_name | regex_replace(pattern="[/\\\\]+$", rep="") %} {% if depth < current_depth %} {% set diff = current_depth - depth %} {% if diff == 1 %}
{% elif diff == 2 %}
{% elif diff == 3 %} {% elif diff >= 4 %} {% endif %} {% set_global current_depth = depth %} {% endif %} {% if is_dir %}
{{ clean_name }}/{% if comment %}// {{ comment }}{% endif %}
{% set_global current_depth = depth + 1 %} {% else %} {% set file_cls = "" %} {% if clean_name is ending_with(pat=".rs") %}{% set file_cls = " file-rust" %} {% elif clean_name is ending_with(pat=".toml") or clean_name is ending_with(pat=".kdl") or clean_name is ending_with(pat=".json") or clean_name is ending_with(pat=".yaml") or clean_name is ending_with(pat=".yml") %}{% set file_cls = " file-config" %} {% elif clean_name is ending_with(pat=".md") or clean_name is ending_with(pat=".txt") %}{% set file_cls = " file-doc" %} {% endif %}
{{ clean_name }}{% if comment %}// {{ comment }}{% endif %}
{% endif %} {% endif %} {% endif %} {% endfor %} {% if current_depth == 1 %}
{% elif current_depth == 2 %} {% elif current_depth == 3 %} {% elif current_depth >= 4 %} {% endif %} {% endcomponent tree %} {% component tabs(id="group") %}
{% set chunks = body | split(pat="===") %} {% for chunk in chunks %} {% if chunk | trim | length > 0 %} {% set lines = chunk | split(pat="\n") %} {% set title = lines[0] | trim %} {% set content = chunk | replace(from=lines[0], to="") | trim %}
{{ content | markdown | safe }}
{% endif %} {% endfor %}
{% endcomponent tabs %} {% component cards() %}
{% set lines = body | split(pat="\n") %} {% for line in lines %} {% if line | trim | length > 0 %} {% set trimmed = line | trim | regex_replace(pattern="^-\\s*", rep="") | trim %} {% set parts = trimmed | split(pat=":") %} {% set raw_title = parts[0] | trim %} {% set title_part = raw_title | regex_replace(pattern="^(nf-[a-zA-Z0-9_-]+)\\s+", rep=" ") %} {% set desc_part = "" %} {% if parts | length > 1 %} {% set desc_part = parts[1] | trim %} {% endif %}
{{ title_part | safe }}
{% if desc_part %}
{{ desc_part | safe }}
{% endif %}
{% endif %} {% endfor %}
{% endcomponent cards %}