{{/* Format Selector Component Provides a dropdown menu for accessing documentation in LLM-friendly formats. Supports both leaf nodes (single pages) and branch nodes (sections with children). Features: - Copy page/section as Markdown - Open in ChatGPT or Claude - Download section ZIP (for large sections) - Future: MCP server integration UI Pattern: Matches Mintlify's format selector style */}} {{- $childCount := 0 -}} {{- $isSection := false -}} {{/* Determine if this is a section (branch node) by checking for child pages */}} {{- if .IsSection -}} {{- $isSection = true -}} {{- range .Pages -}} {{- $childCount = add $childCount 1 -}} {{- end -}} {{- end -}} {{/* Calculate estimated tokens (rough estimate: ~500 tokens per page) */}} {{- $estimatedTokens := mul $childCount 500 -}} {{/* Construct section download URL if applicable */}} {{- $sectionDownloadUrl := "" -}} {{- if $isSection -}} {{- $sectionDownloadUrl = printf "%s-download.zip" .RelPermalink -}} {{- end -}} {{/* Determine product-specific MCP docs URL based on current page path */}} {{- $mcpDocsUrl := "" -}} {{- $path := .RelPermalink -}} {{- if hasPrefix $path "/influxdb3/core/" -}} {{- $mcpDocsUrl = "/influxdb3/core/admin/mcp-server/" -}} {{- else if hasPrefix $path "/influxdb3/enterprise/" -}} {{- $mcpDocsUrl = "/influxdb3/enterprise/admin/mcp-server/" -}} {{- else if hasPrefix $path "/influxdb3/cloud-dedicated/" -}} {{- $mcpDocsUrl = "/influxdb3/cloud-dedicated/admin/mcp-server/" -}} {{- else if hasPrefix $path "/influxdb3/cloud-serverless/" -}} {{- $mcpDocsUrl = "/influxdb3/cloud-serverless/reference/mcp-server/" -}} {{- else if hasPrefix $path "/influxdb3/clustered/" -}} {{- $mcpDocsUrl = "/influxdb3/clustered/reference/mcp-server/" -}} {{- else if hasPrefix $path "/influxdb/cloud/" -}} {{- $mcpDocsUrl = "/influxdb/cloud/reference/mcp-server/" -}} {{- else if hasPrefix $path "/influxdb/v2/" -}} {{- $mcpDocsUrl = "/influxdb/v2/reference/mcp-server/" -}} {{- else if hasPrefix $path "/influxdb/v1/" -}} {{- $mcpDocsUrl = "/influxdb/v1/tools/mcp-server/" -}} {{- else if hasPrefix $path "/enterprise_influxdb/v1/" -}} {{- $mcpDocsUrl = "/enterprise_influxdb/v1/tools/mcp-server/" -}} {{- else if hasPrefix $path "/telegraf/" -}} {{- $mcpDocsUrl = "/telegraf/v1/mcp-server/" -}} {{- else -}} {{/* Default to Core docs for other products (Flux, Kapacitor, Chronograf) */}} {{- $mcpDocsUrl = "/influxdb3/core/admin/mcp-server/" -}} {{- end -}} {{/* Only show format selector on documentation pages, not on special pages */}} {{- if not (in .RelPermalink "/search") -}}