Skip to content

Commit a925d9b

Browse files
committed
feat(llms): consolidate Lambda@Edge markdown
generator into docs-v2 Move Lambda@Edge function from docs-tooling to deploy/llm-markdown with shared conversion library using relative imports. Update documentation.
1 parent 95ea8df commit a925d9b

File tree

14 files changed

+3315
-462
lines changed

14 files changed

+3315
-462
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ tmp
4545

4646
# External repos
4747
.ext/*
48+
49+
# Lambda deployment artifacts
50+
deploy/llm-markdown/lambda-edge/markdown-generator/*.zip
51+
deploy/llm-markdown/lambda-edge/markdown-generator/package-lock.json

DOCS-DEPLOYING.md

Lines changed: 64 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
# Deploying InfluxData documentation
22

3-
## Lambda@Edge Markdown Generator
3+
## Lambda\@Edge Markdown Generator
44

5-
docs.influxdata.com uses a Lambda@Edge function for on-demand markdown generation from HTML documentation. The generated markdown files are an alternative rendering of the documentation designed to be used by generative engines such as LLMs, coding assistants, and agents.
6-
7-
### Overview
8-
9-
The Lambda@Edge function intercepts CloudFront requests for `.md` files (primarily served for LLM consumption) and generates them on-demand from S3-hosted HTML content.
5+
docs.influxdata.com uses a Lambda\@Edge function for on-demand markdown generation from HTML documentation. The generated markdown files are optimized for LLMs, coding assistants, and agents.
106

117
### Architecture
128

@@ -19,11 +15,71 @@ Lambda@Edge (Origin Request)
1915
2016
Fetch HTML from S3
2117
22-
Convert to Markdown
18+
Convert to Markdown (using shared library)
2319
2420
Return to CloudFront (cached 1hr)
2521
2622
User receives Markdown
2723
```
2824

29-
See the `influxdata/docs-tooling` private repository for details.
25+
### Repository Structure
26+
27+
All markdown generation code is in this repository:
28+
29+
```
30+
docs-v2/
31+
├── scripts/
32+
│ ├── lib/markdown-converter.js # Shared conversion library
33+
│ └── html-to-markdown.js # Local CLI for testing
34+
├── deploy/
35+
│ └── llm-markdown/
36+
│ ├── README.md # Lambda deployment guide
37+
│ └── lambda-edge/
38+
│ └── markdown-generator/
39+
│ ├── index.js # Lambda handler
40+
│ ├── lib/s3-utils.js # S3 operations
41+
│ ├── deploy.sh # Deployment script
42+
│ └── package.json # Lambda dependencies
43+
└── cypress/e2e/content/
44+
└── markdown-content-validation.cy.js # Validation tests
45+
```
46+
47+
### Local Development
48+
49+
Generate markdown files locally for testing:
50+
51+
```bash
52+
# Prerequisites
53+
yarn install
54+
yarn build:ts
55+
npx hugo --quiet
56+
57+
# Generate markdown for specific path
58+
node scripts/html-to-markdown.js --path influxdb3/core/get-started --limit 10
59+
60+
# Run validation tests
61+
node cypress/support/run-e2e-specs.js \
62+
--spec "cypress/e2e/content/markdown-content-validation.cy.js"
63+
```
64+
65+
See [DOCS-TESTING.md](DOCS-TESTING.md) for comprehensive testing documentation.
66+
67+
### Lambda Deployment
68+
69+
Deploy the Lambda\@Edge function to AWS:
70+
71+
```bash
72+
# Navigate to Lambda directory
73+
cd deploy/llm-markdown/lambda-edge/markdown-generator
74+
75+
# Install dependencies
76+
npm install
77+
78+
# Deploy to staging
79+
./deploy.sh staging
80+
81+
# Deploy to production
82+
./deploy.sh production
83+
```
84+
85+
See [deploy/llm-markdown/README.md](deploy/llm-markdown/README.md) for detailed deployment instructions.

0 commit comments

Comments
 (0)