Commit Graph

24 Commits (feat-api-uplift)

Author SHA1 Message Date
Jason Stirnaman 4f430457cb refactor(api): replace hardcoded product configs with auto-discovery
Replace the 110-line productConfigs map with auto-discovery from
.config.yml files. The generation script now derives Hugo paths,
menu keys, and static file names from directory structure and
existing frontmatter.

Key changes:
- discoverProducts() scans api-docs/ for .config.yml files
- Each API entry generates independently (no mergeArticleData)
- New frontmatter params: specDownloadPath, articleDataKey, articleSection
- Templates use frontmatter lookup instead of hardcoded URL-to-key maps
- list.html download button simplified from 50 lines to 5
- Cypress tests updated for Hugo-native-only URLs
2026-03-15 17:01:27 -05:00
Jason Stirnaman fc1f93680b style(api): use Redocly anchor format and flatten operation layout
- Switch operation anchors from {method}-{path} to
  operation/{operationId} (PascalCase), matching Redocly convention
  and existing content links like #operation/PutPluginFile.
  Updated in Hugo templates, all-endpoints list, and JS TOC.

- Remove nested bordered containers from API operations. Operations
  separated by top-border dividers instead of card wrappers. Param
  lists, schema properties, and responses no longer wrapped in
  bordered boxes.

- Replace CSS custom properties (var(--article-text, ...)) with SCSS
  theme variables ($article-text, $article-heading, $nav-border, etc).
  The CSS vars were never defined in this theme, so all text fell back
  to hardcoded dark-gray values invisible in dark mode.

- Delete entire dark mode override section — now handled automatically
  by Hugo's per-theme SCSS compilation.

- Add border-bottom divider to operation endpoint line for visual
  separation from the operation heading.

- Update PLAN.md to mark Task 7 as completed.
2026-03-06 14:35:54 -06:00
Jason Stirnaman 2b3ed56218 refactor(api): complete Hugo-native migration, remove RapiDoc
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).
2026-02-13 15:07:02 -06:00
Jason Stirnaman 4959d93c26 feat(api): add Hugo-native API rendering POC
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.
2026-02-13 00:07:18 -06:00
Jason Stirnaman 345bdc3058 fix(api): use reliable path extraction for dual download buttons
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"
2026-02-06 11:15:09 -06:00
Jason Stirnaman 89c62812f6 fix(api): add context-aware download buttons for dual-API products 2026-02-06 11:06:21 -06:00
Jason Stirnaman 41b23f5810 fix(api): align dual download button SVGs and styles with single.html 2026-02-06 11:03:19 -06:00
Jason Stirnaman ad91a34b1c feat(api): add dual download buttons for Clustered/Cloud Dedicated
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.
2026-02-06 10:59:47 -06:00
Jason Stirnaman f740f29dd9 feat(api): update API layouts and UI components
- Enhance section-children partial for tag-based article display
- Update all-endpoints-list with improved operation linking
- Refine security-schemes partial layout
- Update api-toc.ts for better navigation handling
- Improve api-menu-items sidebar rendering
- Update security schemes SCSS styling
- Remove outdated LLMS-TXT-README.md
2026-02-03 20:11:42 -06:00
Jason Stirnaman 727a9befb7 feat(api): consolidate API docs to tag pages with inline operations
Migrate API documentation from individual operation pages to tag pages
where all operations for a tag are rendered inline using RapiDoc.

Key changes:
- Remove operation links from left sidebar (tags only, no children)
- Generate server-side TOC from frontmatter operations array
- Show method badge + human-readable summary in TOC (not paths)
- Support hash-based navigation (#post-/api/v3/configure/distinct_cache)
- RapiDoc scrollToPath() handles TOC clicks to shadow DOM elements
- goto-path attribute initializes to operation from URL hash
- update-route attribute updates URL hash as user navigates

Files created:
- layouts/partials/api/rapidoc-tag.html

Files removed:
- layouts/api-path/path.html (path page layout)
- layouts/partials/api/rapidoc-path.html (path page partial)
- Old design documents superseded by 2026-01-21 version

Files modified:
- layouts/api/list.html (embed RapiDoc, server-side TOC)
- layouts/api/section.html (simplified section layout)
- layouts/_default/api.html (fallback layout cleanup)
- layouts/partials/sidebar/api-menu-items.html (remove op children)
- assets/js/components/rapidoc-mini.ts (tag page support)
- assets/js/components/api-toc.ts (RapiDoc navigation)
- api-docs/scripts/generate-openapi-articles.ts (disable path pages)
2026-01-29 23:46:09 -06:00
Jason Stirnaman 279b17002d fix(api): update tag page links to use path URLs with anchors
Links now point to /api/v3/path/#method instead of /api/v3/path/method/
2026-01-20 15:16:54 -06:00
Jason Stirnaman 138e9e4f6e feat(api): add All endpoints page and fix v2 menu warnings
- Add "All endpoints" page showing all operations grouped by API version
- Generate all-endpoints page automatically via TypeScript generation script
- Make "All endpoints" nav item a clickable link instead of just a toggle
- Fix duplicate menu entry warnings for cloud-v2 and oss-v2 products
  by adding skipParentMenu: true to their configs
- Fix 404 errors for paths with curly braces (e.g., {request_path})
  by removing braces in normalize-path.html partial
- Add Cypress tests for API section structure and all-endpoints page
- Update v2 product article data with tag-based generation
2026-01-14 17:27:39 -06:00
Jason Stirnaman 216795f0d4 feat(api): normalize API paths with version prefixes
- Add normalize-path.html partial for consistent path normalization
- Strip /api prefix and add v1/ for paths without version
- Update generate-openapi-articles.ts with same normalization logic
- Update list.html and sidebar menu to use normalized paths
- Document AWS credentials in deploy-staging.sh
2026-01-02 16:42:30 -06:00
Jason Stirnaman 149b9c0745 fix(api): improve API section index children display
- Always show children after content (was showing either/or)
- Use children-links class for arrow indicator styling
- Truncate descriptions to first paragraph and 200 chars
- Apply markdownify filter for proper markdown rendering
2026-01-02 16:42:30 -06:00
Jason Stirnaman 5866560100 fix(api): render children listing on API section index pages
Update Hugo templates to correctly display API children listing on
section index pages (/influxdb3/core/api/, /influxdb3/enterprise/api/)
instead of the RapiDoc renderer.

- Create layouts/api/section.html for API section pages
- Update layouts/_default/api.html to detect section pages and render
  content directly instead of using RapiDoc
- Clean up layouts/api/list.html debug comment

The issue was that layouts/_default/api.html took precedence over
layouts/api/list.html for section pages due to Hugo's type-based
template lookup. The fix adds .IsSection check to delegate section
pages to appropriate rendering logic.
2026-01-02 16:42:30 -06:00
Jason Stirnaman d258fa52cf fix(api): Remove duplicated Authentication section 2026-01-02 16:42:29 -06:00
Jason Stirnaman 82ec8ef722 feat(api): Display security schemes on conceptual API pages 2026-01-02 16:42:28 -06:00
Jason Stirnaman beb8088417 feat(api): Add section index and All endpoints nav item
- Add api/section-children.html partial for API section index pages
- Update api/list.html to detect section index vs tag pages
- Add "All endpoints" nav item listing all operations sorted by method+path
- Remove {{< children >}} shortcode from API index pages (use data-driven list)
2026-01-02 16:42:27 -06:00
Jason Stirnaman 2fa00a36d2 fix(api): Fix RapiDoc operation filtering and improve API reference quality
- Restore original RapiDoc match-paths format (method /path) for proper filtering
- Restrict operation tags to primary tag in tag-specific specs to prevent duplicates
- Rename Token tag to Auth token for clarity in Core and Enterprise specs
- Remove Table tag from cache operations (distinct_cache, last_cache)
- Add build script combining API docs, Hugo, and Markdown generation
- Skip summary rendering for conceptual pages
- Add isConceptual check to hide operations in nav for conceptual pages
2026-01-02 16:42:27 -06:00
Jason Stirnaman a1132142ff feat(api): Add RapiDoc Mini component for API operation pages
The feature is shippable, but needs a few small fixes and we'll need to update or alias all API docs links for Core and Ent3.

- Add rapidoc-mini.ts TypeScript component with CDN loading and theme sync
- Add api-operation layout for standalone operation pages
- Add rapidoc-mini.html partial for reusable RapiDoc rendering
- Add rapidoc-custom.css for RapiDoc style overrides
- Register rapidoc-mini component in main.js
- Add article data for cloud-dedicated and clustered products
- Update API reference Cypress tests
2026-01-02 16:42:27 -06:00
Jason Stirnaman a7f75b8b25 fix(api): Extract first sentence for header summary, add Overview section
- 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
2026-01-02 16:42:26 -06:00
Jason Stirnaman e42999ee98 feat(api): Update Hugo layouts for tag-based API documentation
- 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
2026-01-02 16:42:25 -06:00
Jason Stirnaman 802f7fac1e fix(api): Add operations list styling and regroup sidebar navigation
- 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
2026-01-02 16:42:24 -06:00
Jason Stirnaman 4d88770ed3 feat(api): Uplift API reference docs with Scalar renderer
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]
2026-01-02 16:41:59 -06:00