Skip to content

Conversation

@jstirnaman
Copy link
Contributor

  • Provides a selector menu in each page with the following options:
    • Copy page Markdown
    • Copy section Markdown (for section pages)
    • Ask ChatGPT
    • Ask Claude
  • The markdown is generated directly from the HTML by a function run by AWS Lambda and maintained in influxdata/docs-tooling
  • Adds e2e tests

sanderson and others added 8 commits November 19, 2025 16:52
Implement automated llms.txt file generation following the llmstxt.org
specification for LLM discovery of documentation.

Changes:
- Add Hugo templates for llms.txt generation (site and section level)
- Configure llmstxt output format in Hugo config
- Integrate html-to-markdown.js into CircleCI build pipeline
- Add comprehensive documentation for llms.txt system
- Update scripts README with CI/CD integration details

The llms.txt files are now generated automatically during build from
content structure and product metadata in data/products.yml, eliminating
the need for hardcoded files and ensuring maintainability.

Build pipeline now runs: Hugo build → Markdown conversion → Deploy
- Fix selector specificity: use .format-selector__button instead of button
  to avoid matching multiple buttons (main button + dropdown options)
- Add automated markdown generation in test setup via cy.exec()
- Implement dynamic content validation that extracts HTML content and
  verifies it appears in markdown version
- Optimize tests with nested describe blocks to minimize dropdown opens
- Relax content expectations to check structure instead of specific strings
- Remove fragile/outdated tests

Results: 14/14 tests passing (100%), down from 5/25 (20%)
Duration: 20s (81% faster than original 105s)
- Add HTML-to-Markdown converter with table and list formatting
- Add centralized product detection utilities
- Add Node.js module shim for dual-environment TypeScript
- Convert page-context.js to TypeScript for type safety
- Add comprehensive Cypress tests for table formatting
- Fix version detector modal timing issues
- Update markdown URL pattern to /path/index.md

Related to llmstxt.org specification implementation.
- Add section detection and child page discovery in html-to-markdown.js
- Generate index.section.md files for branch pages with aggregated content
- Add section frontmatter with child_count and child_pages metadata
- Implement "Copy section" functionality in format-selector.ts
- Section markdown includes all child pages separated by ---

This enables LLM-friendly documentation for entire sections,
allowing users to copy complete documentation sections with a single click.
…ction markdown

- Comment out 'Download section' UI option (not yet implemented)
- Comment out handleDownloadSection function
- Strip first H1 heading from child pages to avoid duplication
- Child pages now only show H2 heading when aggregated

This fixes the issue where section markdown showed both:
## Page Title (our H2)
# Page Title (original H1 from child page content)
@jstirnaman jstirnaman force-pushed the jts-feat-llm-text branch 3 times, most recently from d8df418 to a925d9b Compare November 20, 2025 21:33
  generator into docs-v2

  Move Lambda@Edge function from docs-tooling to
  deploy/llm-markdown with
  shared conversion library using relative imports. Update
  documentation.
- Add root /llms.txt following llmstxt.org spec pointing to .section.md files
- Convert Lambda@Edge markdown generator from ES6 to CommonJS for compatibility
- Add Lambda test payloads and improved error handling to deployment docs
- Fix format-selector rendering on landing pages
- Fix format-selector dropdown overflow issue
- Remove broken section-level llms.txt generation (1,114 files)
- Add S3 bucket configuration via config.json for Lambda@Edge
- Update .gitignore for Lambda deployment artifacts and TS build files

Lambda@Edge now generates .md files on-demand with:
- Evaluated Hugo shortcodes
- Proper YAML frontmatter with product metadata
- Clean markdown without UI elements
- Section aggregation (parent + children in single file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants