Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/compile-llms-txt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Compile llms.txt

on:
push:
branches:
- main
paths:
- 'docs/**/*.mdx'

jobs:
compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Compile llms.txt
run: |
cd docs
python compile_llms.py
- name: Commit and push changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add docs/llms.txt
git commit -m "Update llms.txt" || exit 0
git push
37 changes: 37 additions & 0 deletions docs/compile_llms_txt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import os

def compile_llms_txt():
# Get the docs directory path (where this script is located)
docs_dir = os.path.dirname(os.path.abspath(__file__))
content = ''
# Define names of directories and files to exclude
excluded_names = {'tool'}

# Change to docs directory
os.chdir(docs_dir)

for root, _, files in os.walk('.'):
# Get the last part of the current directory
current_dir = os.path.basename(root)
if current_dir in excluded_names:
continue

for file in files:
if file.endswith('.mdx'):
if file in excluded_names:
continue

file_path = os.path.join(root, file)
relative_path = os.path.relpath(file_path, '.')

with open(file_path, 'r', encoding='utf-8') as f:
file_content = f.read()
content += f"## {relative_path}\n\n{file_content}\n\n"

# Write the complete content, replacing the existing file
output_path = os.path.join(docs_dir, 'llms.txt')
with open(output_path, 'w', encoding='utf-8') as f:
f.write(content)

if __name__ == "__main__":
compile_llms_txt()
95 changes: 0 additions & 95 deletions docs/development.mdx

This file was deleted.

Loading
Loading