Conversation
Code reviewFound 1 issue:
docs-v2/layouts/partials/api/rapidoc.html Lines 95 to 110 in 90044bd 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
3c7ad96 to
4fccddc
Compare
|
PR Preview
Pages included in this preview
Preview auto-deploys on push. Will be cleaned up when PR closes. |
|
Works with Core and Enterprise, currently. Deployed to staging. |
|
@claude The last commit fixed the children list in the /api/ section page template, but broke the endpoint page template. Analyze. |
✅ |
Replace legacy API documentation approach with modern Scalar-based rendering:
## Architecture Changes
- Add renderer abstraction (`layouts/partials/api/`) supporting Scalar and RapiDoc
- Create `api` layout type for API reference pages (single.html, list.html)
- Configure renderer via `site.Params.apiRenderer` (default: scalar)
## OpenAPI Processing Pipeline (TypeScript)
- `api-docs/scripts/generate-openapi-articles.ts` - Main generation script
- `api-docs/scripts/openapi-paths-to-hugo-data/` - OpenAPI to Hugo data converter
- Generates per-endpoint path fragments for AI agent access
- Creates Hugo content pages with `type: api` frontmatter
## AI Agent Accessibility
- Full specs at `/openapi/influxdb-{product}.yml` and `.json`
- Per-endpoint fragments at `/openapi/influxdb-{product}/paths/`
- `<link rel="alternate">` tags in HTML for machine discovery
## Scalar Features
- Dark/light theme support synchronized with site theme
- InfluxData brand colors
- Responsive layout
- Download link for OpenAPI spec
## Products Supported
- cloud-v2, oss-v2
- influxdb3-core, influxdb3-enterprise
- cloud-dedicated, cloud-serverless, clustered
Usage: node api-docs/scripts/dist/generate-openapi-articles.js [product]
- latest-patch.html: Replace deprecated .Store with local variable assignment. The .Store method was removed from shortcode context in newer Hugo versions. - api-endpoint.html: Add nil check for productRef lookup to prevent index errors when productKey is not in productAliases dictionary. Falls back to "influxdb" as default product reference.
- yarn build:api-docs: Generate API docs for all products - yarn build:api-docs cloud-v2: Generate for specific product - yarn build:api-docs:compile: Recompile TypeScript if modified
…. Split ui-dev subagent into hugo-, ts-, and testing-specific agents.
- Add CSS for operations list cards with method badges, paths, and summaries - Remove duplicate Overview section from list.html (was duplicating summary) - Split "Data Operations" into separate nav groups: Write data, Query data, Cache data
- Add support for tag-based article generation with operations metadata - Generate articles.yml data files with tag, menuName, and isConceptual fields - Include operations array in frontmatter for tag pages
- Rewrite single.html for operation pages with RapiDoc integration - Simplify rapidoc.html partial for tag-based rendering - Add sidebar-nav include to sidebar.html for API navigation - Add tab-panels.html and tabs.html for content organization
- Add api-nav.ts for sidebar navigation collapse/expand - Add api-scalar.ts for Scalar API renderer integration - Add api-tabs.ts for tab switching functionality - Add api-toc.ts for table of contents generation - Register components in main.js
- Add YAML article data files for all InfluxDB products - Add sidebar-nav.html partial for API navigation rendering - Rename data directory from article-data to article_data for Hugo compatibility - Remove obsolete JSON articles file
- Update hugo.yml config for API docs settings - Simplify _api-overrides.scss (removed hardcoded content styles) - Import _api-layout.scss in styles-default.scss - Update API landing pages for Core and Enterprise with redirects - Update OpenAPI spec files - Update dependencies
- Update tests for new tag-based API page structure - Add tests for operations list rendering - Add tests for sidebar navigation groups
…tion - Header summary now shows only the first sentence from description using regex extraction with fallback to first line for descriptions without sentence-ending punctuation - Added Overview section with full description after endpoints list
- Sidebar nav now shows operations with method badges and paths instead of duplicating tag names when groups are expanded - Added background color to nav group items to match sidebar - Increased max-height for expanded groups to accommodate all operations - Added styles for operation items in sidebar nav (.api-nav-operation) - Fixed summary paragraph width by setting flex-basis to 100%
On the API section index pages for InfluxDB 3 Clustered and Cloud Dedicated, show two download buttons side-by-side: one for the Data API spec and one for the Management API spec. The implementation extracts product/version from the URL using findRE pattern, detects Clustered or Cloud Dedicated from version segment, renders dual buttons only on section index pages (no tag param), uses flexbox layout that stacks on mobile, and includes dark mode styling consistent with existing UI.
Replace unreliable findRE regex with split-based path extraction for version detection in API section index pages. The previous regex "[^/]+.*?" was inconsistent and could fail to extract version correctly. Changes: - layouts/_default/api.html: Add dual-button logic for clustered/cloud-dedicated section index pages using split-based URL path extraction - layouts/api/list.html: Replace findRE with split for version extraction - layouts/api/section.html: Add dual-button logic matching api.html The split approach extracts path segments reliably: /influxdb3/clustered/api/ → ["", "influxdb3", "clustered", "api", ""] $version = index 2 = "clustered"
- Update Authentication tag to cover both token types (management + database) - Update Quick start to cover complete workflow (setup → write → query) - Add dual download buttons on API landing pages - Add context-aware download buttons on tag pages - Remove old v2 HTML pages and duplicate auth directories - Clean up management API specs (remove duplicate auth tags) Part of API reference migration from Redoc to RapiDoc.
- Replace /api/management/ links with appropriate alternatives - Link to Database tokens API for token creation - Use "Management operations" text instead of broken links - Update Quick start to link to Databases API
- Add x-influxdatadocs-related support in TypeScript for tags and operations - Remove inline "Related guides" sections from OpenAPI descriptions - Move related links to structured x-influxdatadocs-related arrays - Add weight support for Quick start pages (weight: 1) to appear first in nav - Update clustered and cloud-dedicated v2/ref.yml specs
- Replace #operation/OperationId links with page-based URLs (e.g., #operation/GetLegacyQuery → /influxdb3/clustered/api/query-data/) - Fix Quick start menu ordering by sorting nav items by weight - Add default weight (100) to all articles for consistent sorting - Quick start gets weight 1 to appear first in navigation
Add Hugo-native rendering as alternative to RapiDoc for API documentation. Renders operations, parameters, request bodies, schemas, and responses using Hugo templates styled after docusaurus-openapi aesthetic. New partials: - tag-renderer.html: Main renderer that loads OpenAPI spec - operation.html: Operation block with header and sections - parameters.html: Groups query/path/header parameters - parameter-row.html: Individual parameter rendering - request-body.html: Request body with schema - schema.html: Recursive JSON schema rendering - responses.html: Response status codes with schemas Features: - Parses OpenAPI YAML at build time (no JS required) - Resolves $ref references for parameters and schemas - Displays JSON examples from spec - Color-coded status badges (2xx green, 4xx red) - x-influxdata-related links rendered at page bottom - Dark mode support - Responsive design Enable with `useHugoNative: true` in page frontmatter.
Complete Tasks 1-5 of the Hugo-native API migration: - Promote Hugo-native templates from POC to production location - Remove RapiDoc templates (rapidoc.html, rapidoc-tag.html, rapidoc-mini.html) - Remove RapiDoc JS components (api-rapidoc.ts, rapidoc-mini.ts) - Clean up generation scripts (~200 lines of dead code removed) - Rewrite Cypress tests for standard HTML (no shadow DOM) Templates moved from layouts/partials/api/hugo-native/ to parent. All verifications pass (Hugo build, TypeScript compilation).
Remove all RapiDoc-specific code from styles and JavaScript: - Delete rapi-doc::part() CSS selectors from _api-layout.scss - Delete dead auth modal styles from _api-security-schemes.scss - Delete api-auth-input.ts component (RapiDoc "Try it" integration) - Delete static/css/rapidoc-custom.css (unused) - Remove setupRapiDocNavigation() from api-toc.ts - Update comments to remove RapiDoc references Rename _api-hugo-native.scss to _api-operations.scss since Hugo-native is now the standard (not a POC).
Design for --clean/--no-clean/--dry-run flags in generate-openapi-articles.ts to prevent stale files when tags are renamed or removed.
10 bite-sized tasks for implementing --no-clean and --dry-run flags in generate-openapi-articles.ts.


API reference uplift:
Latest screenshot:
