Skip to content

Commit 60cf733

Browse files
committed
Generate llms.txt and doc-content.txt for AI tools
This commit adds the generations of llms.txt (more robust than what was there) as well a single docs-content.txt that can be fed to an agent or answer engine to set context of how to work with Flox. This does add a Makefile (sorry) because I needed something to run multiple steps when building the documentaiton site. The README has been updated to explain Makefile usage (and it's completely optional). The tools directory is also new, with a small python file to generate the AI indexing files. The robots.txt that helps the crawlers know where to work is maintained in the flox/floxwebsite repo.
1 parent b932608 commit 60cf733

File tree

6 files changed

+530
-1
lines changed

6 files changed

+530
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
with:
4444
command: |
4545
mkdocs build
46+
python3 tools/generate_llms_txt.py ./site
4647
mkdir -p ./public/docs
4748
cp -R ./site/* ./public/docs/
4849
chmod -R +w ./public/docs

Makefile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Flox Documentation Makefile
2+
3+
.PHONY: help dev build clean install
4+
5+
# Default target
6+
help:
7+
@echo "Available targets:"
8+
@echo " dev - Start development server with live reload"
9+
@echo " build - Build static site and generate AI files"
10+
@echo " clean - Clean build artifacts"
11+
@echo " install - Install dependencies"
12+
@echo " help - Show this help message"
13+
14+
# Development server with live reload
15+
dev:
16+
@echo "Starting development server..."
17+
@echo "Site will be available at: http://127.0.0.1:8000"
18+
@echo "Press Ctrl+C to stop"
19+
mkdocs serve
20+
21+
# Build static site and generate AI files
22+
build:
23+
@echo "Building static site..."
24+
mkdocs build
25+
@echo "Generating AI files..."
26+
python3 tools/generate_llms_txt.py ./site
27+
@echo "✅ Build complete! Site available in ./site/"
28+
29+
# Clean build artifacts
30+
clean:
31+
@echo "Cleaning build artifacts..."
32+
rm -rf site/
33+
rm -rf public/
34+
@echo "✅ Clean complete!"
35+
36+
# Install dependencies (if needed)
37+
install:
38+
@echo "Installing dependencies..."
39+
@if command -v poetry >/dev/null 2>&1; then \
40+
poetry install; \
41+
else \
42+
echo "Poetry not found. Please install dependencies manually."; \
43+
fi

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,53 @@ Live at: [flox.dev/docs](https://flox.dev/docs).
44

55
## Usage
66

7+
### Quick Start
8+
9+
```bash
10+
# Activate the Flox environment
11+
$ flox activate
12+
✅ You are now using the environment 'floxdocs'.
13+
14+
# Start development server
15+
λ (floxdocs) $ make dev
16+
```
17+
18+
The documentation will be available at `http://127.0.0.1:8000` with live reload.
19+
20+
### Available Commands
21+
22+
```bash
23+
make dev # Start development server with live reload
24+
make build # Build static site and generate AI files
25+
make clean # Clean build artifacts
26+
make help # Show all available commands
727
```
28+
29+
### Flox Native Usage
30+
31+
You can still use the original Flox services approach:
32+
33+
```bash
834
$ flox activate
935
✅ You are now using the environment 'floxdocs'.
1036

1137
λ (floxdocs) $ flox services start mkdocs
1238
✅ Service 'mkdocs' started.
13-
1439
```
40+
1541
Once mkdocs service started you can preview the documentation at
1642
`https://127.0.0.1:8000`.
1743

44+
## AI-Friendly Documentation
45+
46+
This documentation site automatically generates AI-friendly files for different use cases:
47+
48+
- **`llms.txt`** - Optimized for AI agents with critical rules, workflows, and organized sitemap
49+
- **`docs-content.txt`** - Comprehensive content for answer engines and RAG systems
50+
51+
These files are automatically generated during the build process and are available at:
52+
- `https://flox.dev/docs/llms.txt`
53+
- `https://flox.dev/docs/docs-content.txt`
1854

1955
## Guidelines
2056

tools/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Tools
2+
3+
This directory contains build tools and utilities for the Flox documentation site.
4+
5+
## Scripts
6+
7+
### `generate_llms_txt.py`
8+
9+
Generates AI-friendly documentation files from the built MkDocs site:
10+
11+
- **`llms.txt`** - Agent-focused file with critical rules, workflows, and organized sitemap
12+
- **`docs-content.txt`** - Answer engine file with comprehensive documentation content
13+
14+
**Usage:**
15+
```bash
16+
python3 tools/generate_llms_txt.py <site_directory>
17+
```
18+
19+
### `generate_llms_txt.sh`
20+
21+
Convenience script for local development. Generates both AI files after a MkDocs build.
22+
23+
**Usage:**
24+
```bash
25+
mkdocs build
26+
./tools/generate_llms_txt.sh
27+
```
28+
29+
## Integration
30+
31+
These scripts are automatically run during CI builds in `.github/workflows/ci.yml` to ensure the AI files are always up-to-date with the documentation content.

0 commit comments

Comments
 (0)