Commit Graph

25 Commits (3a56561cfa55534999a093b99ff986102e3d5625)

Author SHA1 Message Date
Jason Stirnaman 3a56561cfa style(api): remove RapiDoc styles and rename hugo-native to operations
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).
2026-02-13 22:35:22 -06:00
Jason Stirnaman da077a21b4 refactor(api): move Related guides to x-influxdatadocs-related field
- 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
2026-02-06 13:48:31 -06:00
Jason Stirnaman 91f17c2f05 style(api): apply prettier formatting to compiled JS 2026-02-03 20:12:19 -06:00
Jason Stirnaman 244f0f3f11 feat(api): enhance OpenAPI article generation scripts
- Add tag-based article generation with operation grouping
- Support x-influxdata-related field for related content links
- Improve spec transformation with documentation link handling
- Add JSON output alongside YAML for article data
- Enhance path and tag spec generation for per-operation pages
2026-02-03 20:11:02 -06:00
Jason Stirnaman 6138ebf7f1 fix(api): fix sidebar HTML, rebuild compiled JS, update all-endpoints links
Fixes:
- Remove stray </li> tag in api-menu-items.html causing invalid HTML
- Reformat minified sidebar template for maintainability
- Rebuild compiled JS to sync generatePathPages disabled state
- Update all-endpoints links to use tag page URLs with hash anchors
  (e.g., /api/cache-data/#post-/api/v3/configure/distinct_cache)
  instead of now-removed path pages
2026-01-29 23:47:58 -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 6352e99559 chore(api): update compiled generation script 2026-01-20 15:39:14 -06:00
Jason Stirnaman 2fb5168b2b style: apply prettier formatting to scripts and tests 2026-01-14 17:31:55 -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 eb6feb75d2 fix(api): remove curly braces from URL paths and clean up section pages
- Fix apiPathToSlug() to strip curly braces from path parameters
  (e.g., {db} → db) to avoid URL encoding issues in Hugo
- Update Quick start tag description to include intro sentence:
  "Authenticate, write, and query with the API:"
- Remove {{< children >}} shortcode from API section _index.md files
  (layout's section-children.html partial already handles tag listing)
- Delete old cloud-serverless API pages with curly braces in paths
- Regenerate article data for all products
2026-01-08 10:56:05 -06:00
Jason Stirnaman 186721b6f9 feat(api): configure cloud-serverless for tag-based API generation
- Fix specFile path from non-existent management/openapi.yml to v2/ref.yml
- Enable useTagBasedGeneration for consistency with other InfluxDB 3 products
- Update comments to clarify that Cloud Serverless uses standard v2 API
  (not management API like Cloud Dedicated and Clustered)

Cloud Serverless API docs now generate 29 tag-based pages and 125 operation
pages from the v2 API spec.
2026-01-07 15:59:01 -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 9693417fd8 feat(api): Fix API reference tag-based section template (#6686)
* fix(api): refine .IsSection check to prevent breaking endpoint pages

The previous commit added an .IsSection check that correctly fixed
section index pages but inadvertently broke endpoint pages that Hugo
classifies as sections.

This commit refines the conditional to check for the absence of the
staticFilePath parameter, which distinguishes true section index pages
from endpoint pages that need the RapiDoc renderer:

- Section pages (no staticFilePath): Show children listing
- Endpoint pages (with staticFilePath): Use RapiDoc renderer

Fixes the regression introduced in commit 59daf17.

* chore: update Scalar references to RapiDoc in comments

Update code comments and documentation to accurately reflect that
the API documentation uses RapiDoc, not Scalar:

- api-docs/scripts/generate-openapi-articles.ts: Update JSDoc comments
- api-docs/scripts/dist/generate-openapi-articles.js: Update compiled version
- assets/js/components/api-toc.ts: Update implementation comment
- .claude/agents/ts-component-dev.md: Update component reference
- .claude/skills/hugo-template-dev/SKILL.md: Update component reference

The implementation uses RapiDoc throughout, so these comments needed
to be corrected for accuracy.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-02 16:42:30 -06:00
Jason Stirnaman e841ae15ca feat(api): improve parent index pages with intro and children listing 2026-01-02 16:42:30 -06:00
Jason Stirnaman f3c841167b fix(api-docs): resolve duplicate api/api paths and menu warnings
Fixed two issues causing Hugo warnings about duplicate menu entries:

1. Path generation bug: apiPathToSlug returns 'api/v3/...' for paths
   starting with '/api/', but the generator always prepended 'api/',
   creating 'api/api/v3/...' paths.

   Fix: Only add 'api/' prefix if path doesn't already start with it.

2. Config inconsistency: cloud-dedicated, cloud-serverless, and clustered
   had '/api' in pagesDir while core/enterprise didn't. The function
   always adds '/api', causing double prefixes for some products.

   Fix: Removed '/api' from pagesDir for affected products to match
   core/enterprise pattern.
2026-01-02 16:42:30 -06:00
Jason Stirnaman 64c3d7b028 fix(api): propagate showSecuritySchemes to content generation
Add showSecuritySchemes field handling to generate-openapi-articles.ts
to ensure the flag is written to content frontmatter. Regenerate API
docs for cloud-dedicated and clustered products.
2026-01-02 16:42:29 -06:00
Jason Stirnaman 6a4e63be65 feat(api-docs): add link placeholder transformation for OpenAPI specs
Transform /influxdb/version/ placeholders in OpenAPI spec description
and summary fields to product-specific paths at build time.

- Add deriveProductPath() to extract product path from spec location
- Add transformDocLinks() to recursively transform markdown links
- Add validateDocLinks() with --validate-links CLI flag for checking
- Integrate transformation into processProduct() workflow
- Add placeholder links to Authorization header descriptions

The product path is derived from the spec file location, so
api-docs/influxdb3/core/v3/ref.yml produces /influxdb3/core paths.
2026-01-02 16:42:29 -06:00
Jason Stirnaman 6c25072ed3 feat(api): Convert auth input to popover with filtered schemes
- Convert collapsible auth panel to popover UI triggered by
  "Set credentials" button positioned above RapiDoc
- Filter auth schemes based on API path:
  - /api/v3/* endpoints: Bearer only
  - /api/v2/* endpoints: Bearer + Token
  - /write, /query (v1): All 4 schemes
- Fix "Authentication Not Required" bug by adding global security
  field to path-specific OpenAPI specs
- Change RapiDoc --blue CSS variable to green so status text and
  type links don't look like clickable links
- Add explicit button styling for Apply/Clear in popover
- Hide RapiDoc's built-in auth section (use custom popover instead)
2026-01-02 16:42:29 -06:00
Jason Stirnaman 5610b7bdf3 fix(api): Complete Auth token rename and remove Redoc x-tagGroups
- Update api_nav_groups.yml to use "Auth token" instead of "Token"
- Remove x-tagGroups from Core and Enterprise specs (Redoc-specific, not needed for RapiDoc)
- Add migration notes to plan document for future product migrations
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 0328f539c0 feat(api): Add compatibility version badges for v1/v2 endpoints
Add visual badges to distinguish v1-compatible and v2-compatible API
endpoints in the sidebar navigation. This helps users migrating from
InfluxDB v1 or v2 quickly identify which compatibility layer each
endpoint belongs to.

Changes:
- Add x-compatibility-version extension to compatibility operations
- Add externalDocs links to reduce verbose descriptions in specs
- Update generator to extract compatVersion and externalDocs fields
- Display colored badges (purple for v1, cyan for v2) in sidebar nav
- Strip redundant "(v1-compatible)" text when badge is shown
- Add hover tooltips explaining compatibility context
2026-01-02 16:42:27 -06:00
Jason Stirnaman f5fba5a092 chore: Rebuild API generator scripts and update tests 2026-01-02 16:42:26 -06:00
Jason Stirnaman eb33772b60 feat(api): Update OpenAPI article generators for tag-based structure
- 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
2026-01-02 16:42:25 -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