{% extends "base.html" %} {# ================================================================================ API Hub Section Index Template (Kida-Native) ================================================================================ Renders an aggregating section showing all API documentation types. KIDA FEATURES USED: - {% let %} for template-scoped variables - Optional chaining (?.) for null-safe access - Null coalescing (??) for smart defaults - {% match %} for type-based rendering USAGE: Used for sections with type="api-hub" ================================================================================ #} {% from 'partials/navigation-components.html' import breadcrumbs, page_navigation, toc %} {# ============================================================================= API CARD COMPONENT ============================================================================= #} {% def api_card(subsection) %} {% let sub_type = subsection?.params?.type ?? 'python-reference' %} {% let sub_title = subsection?.title ?? 'API' %} {% let sub_href = subsection?.href ?? '#' %} {% let sub_desc = (subsection?.params?.description ?? '') | first_sentence %} {% let sub_subsections = subsection?.subsections ?? [] %} {% let sub_pages = subsection?.pages ?? [] %} {% let child_count = (sub_subsections | length) + (sub_pages | length) %}
{% match sub_type %} {% case _ if 'python' in sub_type %} {{ icon("code", size=32, css_class="icon-python") }} {% case _ if 'openapi' in sub_type %} {{ icon("globe", size=32, css_class="icon-openapi") }} {% case _ if 'cli' in sub_type %} {{ icon("terminal", size=32, css_class="icon-cli") }} {% case _ %} {{ icon("book", size=32, css_class="icon-default") }} {% end %}

{{ sub_title }}

{% if sub_desc %} {{ sub_desc }} {% else %} {% match sub_type %} {% case _ if 'python' in sub_type %} Browse Python packages, modules, and classes. {% case _ if 'openapi' in sub_type %} Explore REST API endpoints and schemas. {% case _ if 'cli' in sub_type %} Command-line tools and options. {% case _ %} API documentation. {% end %} {% end %}

{% enddef %} {# ============================================================================= MAIN TEMPLATE ============================================================================= #} {% block content %} {# Template-scoped variables #} {% let hub_section = section %} {% let hub_title = section?.title ?? 'API Documentation' %} {% let hub_desc = section?.params?.description ?? '' %} {% let subsections = section?.sorted_subsections ?? [] %} {% let page_href = page?.href ?? '/' %} {# Three-column documentation layout #}
{# Left Sidebar: Navigation #} {# Main Content #}
{# Page Hero #}
{% if page_href != '/' %} {% end %}

{{ hub_title }}

{% if hub_desc %}
{{ hub_desc | markdownify | safe }}
{% else %}

Browse all API documentation for this project.

{% end %} {% if subsections | length > 0 %} {% end %}
{# Article Content #}
{% if content and content.strip() %}
{{ content | safe }}
{% end %} {# API Hub Card Grid #} {% if subsections | length > 0 %}
{% for subsection in subsections %} {{ api_card(subsection) }} {% end %}
{% else %}
{{ icon("book-open", size=48, css_class="icon-muted") }}

No API documentation available yet.

Enable Python, OpenAPI, or CLI autodoc in your configuration.

{% end %}
{{ page_navigation(page) }}
{# Right Sidebar #} {% include 'partials/docs-toc-sidebar.html' %}
{# Mobile sidebar toggle #} {% end %}