{% extends "base.html" %} {# ================================================================================ CLI Reference Command Template (Kida-Native) ================================================================================ Renders a CLI command's documentation using the unified autodoc skeleton. Extends base.html to inherit theme navigation, sidebars, and styling. TEMPLATE VARIABLES: - element: DocElement for the command (required) - page: PageContext proxy with title, metadata, tags, _path - config: Autodoc configuration - site: Site instance - section: Parent section (for navigation) Uses the `options` filter to normalize access to options/arguments, providing a consistent API via OptionView: - name, flags, flags_str, type, description - default, required, is_flag, is_argument, multiple, envvar ================================================================================ #} {% from 'partials/navigation-components.html' import breadcrumbs, page_navigation, toc %} {% from 'autodoc/partials/_macros/element-card.html' import element_card %} {% block content %} {# Use options filter for normalized access - returns list of OptionView #} {% let all_opts = element | options %} {% let cli_options = all_opts | rejectattr('is_argument') | list %} {% let cli_arguments = all_opts | selectattr('is_argument') | list %} {% let page_tags = page?.tags ?? [] %} {# Three-column documentation layout #}
{# Left Sidebar: Navigation #} {# Main Content #}
{# Page Hero: Use direct macro call with explicit context #} {% from 'partials/page-hero/_macros.html' import hero_element %} {{ hero_element(element, page, config) }} {# Article Content - Unified autodoc skeleton #}
{# Usage #} {% include 'autodoc/partials/usage.html' %} {# Options (as table) - using OptionView properties #} {% if cli_options | length > 0 %}

Options

{% for opt in cli_options %} {% end %}
Option Type Description
{{ opt.flags_str }} {% if opt.required %} required {% end %} {% if opt.is_flag %} flag {% end %} {{ opt.type }} {{ opt.description | markdownify | safe }} {% if opt.default is not none and opt.default != '' and not opt.is_flag %} Default: {{ opt.default }} {% end %} {% if opt.envvar %} Env: {{ opt.envvar }} {% end %}
{% end %} {# Arguments (as table) - using OptionView properties #} {% if cli_arguments | length > 0 %}

Arguments

{% for arg in cli_arguments %} {% end %}
Argument Type Description
{{ arg.name }} {% if arg.required %} required {% end %} {% if arg.multiple %} multiple {% end %} {{ arg.type }} {{ arg.description | markdownify | safe }} {% if arg.default is not none and arg.default != '' %} Default: {{ arg.default }} {% end %}
{% end %} {# Examples #} {% include 'autodoc/partials/examples.html' %} {# Tags - with null-safe access #} {% if page_tags | length > 0 %} {% 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 %}