{% extends "base.html" %} {# ================================================================================ CLI Reference Section Index Template (Kida-Native) ================================================================================ Renders a CLI section index page showing command groups and commands using a card-based layout. Extends base.html to inherit theme navigation. TEMPLATE VARIABLES: - section: Section object for the CLI section (required) - page: PageContext proxy with title, metadata, _path - config: Autodoc configuration - site: Site instance KIDA FEATURES USED: - Optional chaining (?.) for safe attribute access on nullable objects - Null coalescing (??) for providing defaults - {% let %} for template-scoped computed values - {% match %} for element type icon dispatch - Pipeline-friendly filtering ================================================================================ #} {% from 'partials/navigation-components.html' import breadcrumbs, page_navigation, toc %} {% block content %} {# Template-scoped caching of computed values #} {% let section_subsections = section?.sorted_subsections ?? [] %} {% let section_pages = section?.sorted_pages ?? [] %} {# Build command pages list (non-index pages only) #} {% let command_pages = section_pages | rejectattr('source_path', 'match', '.*_index.*') | reject('eq', section?.index_page) | list %} {# Three-column documentation layout #}
{# Left Sidebar: Navigation #} {# Main Content #}
{# Page Hero: Use direct macro call with CLI context #} {% from 'partials/page-hero/_macros.html' import hero_section %} {{ hero_section(section, page, {'is_cli': true}) }} {# Article Content - autodoc skeleton #}
{# Subsections (Command Groups) - Card Grid #} {% if section_subsections | length > 0 %}

Command Groups

{% for subsection in section_subsections %} {% set subsection_name = subsection?.name ?? '' %} {% if subsection_name %} {% set desc = (subsection?.metadata?.description ?? '') | first_sentence %} {% set child_count = ((subsection?.subsections ?? []) | length) + ((subsection?.pages ?? []) | length) %}
{{ icon("terminal", size=20, css_class="icon-muted") }} {{ subsection_name }}

{{ desc if desc else subsection_name ~ ' commands' }}

{% end %} {% end %}
{% end %} {# Command Pages - Card Grid #} {% if command_pages | length > 0 %}

Commands

{% end %} {# Empty State #} {% if section_subsections | length == 0 and command_pages | length == 0 %}
{{ icon("terminal", size=48, css_class="icon-muted") }}

No CLI documentation available in this section yet.

{% end %}
{# Page navigation (prev/next) at bottom - null-safe #} {% if page %} {{ page_navigation(page) }} {% end %}
{# Right Sidebar: Contextual Graph + TOC + Metadata #} {% include 'partials/docs-toc-sidebar.html' %}
{# Mobile sidebar toggle button #} {# Sidebar overlay for mobile #} {% end %}