Skip to content

Commit 6150625

Browse files
BrandonSharCopilot
andauthored
generate llms full dynamically (#236)
* generate llms full dynamically * added this to npm instead * Update .github/workflows/docs.yml Co-authored-by: Copilot <[email protected]> * Update docs/scripts/extract-docs.js Co-authored-by: Copilot <[email protected]> * lint docs * testing things * fix linter * Update docs/scripts/extract-docs.js Co-authored-by: Copilot <[email protected]> * Update docs/.vitepress/config.mts Co-authored-by: Copilot <[email protected]> * lint after copilot * clean up after copilot --------- Co-authored-by: Copilot <[email protected]>
1 parent 8b9c99b commit 6150625

File tree

7 files changed

+485
-0
lines changed

7 files changed

+485
-0
lines changed

.github/workflows/docs.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,14 @@ jobs:
3939
- name: Check formatting
4040
working-directory: ./docs
4141
run: npm run format:check
42+
43+
- name: Generate LLM-friendly documentation
44+
working-directory: ./docs
45+
run: node scripts/extract-docs.js
46+
47+
- name: Upload LLM docs artifact
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: llm-docs
51+
path: public/llms-full.txt
52+
retention-days: 90

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
/tmp/
99
/.cache/
1010
/Gemfile.lock
11+
.DS_Store
1112

1213
/spec/dummy/db/*.sqlite3
1314
/spec/dummy/db/*.sqlite3-journal

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
.vitepress/dist
33
.vitepress/cache
4+
public/llms-full.txt

docs/.vitepress/config.mts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
import { execSync } from 'child_process'
2+
import { dirname, join } from 'node:path'
3+
import { fileURLToPath } from 'node:url'
14
import { defineConfig } from 'vitepress'
25
import { tabsMarkdownPlugin } from './vitepress-plugin-tabs/tabsMarkdownPlugin'
36

7+
const __filename = fileURLToPath(import.meta.url)
8+
const __dirname = dirname(__filename)
9+
410
const title = 'Inertia Rails'
511
const description = 'Documentation for Inertia.js Rails adapter'
612
const site = 'https://inertia-rails.dev'
@@ -13,6 +19,22 @@ export default defineConfig({
1319

1420
cleanUrls: true,
1521

22+
vite: {
23+
plugins: [
24+
{
25+
name: 'generate-llm-docs',
26+
buildStart() {
27+
// Regenerate LLM docs before build
28+
console.log('Regenerating LLM documentation...')
29+
execSync('node scripts/extract-docs.js', {
30+
cwd: join(__dirname, '..'),
31+
})
32+
console.log('LLM documentation updated!')
33+
},
34+
},
35+
],
36+
},
37+
1638
markdown: {
1739
config(md) {
1840
md.use(tabsMarkdownPlugin)

docs/package-lock.json

Lines changed: 109 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"format": "prettier --write ."
88
},
99
"devDependencies": {
10+
"gray-matter": "^4.0.3",
1011
"markdown-it-container": "^4.0.0",
1112
"prettier": "^3.3.3",
1213
"prettier-plugin-organize-imports": "^4.1.0",

0 commit comments

Comments
 (0)