Skip to content

Commit 0873b07

Browse files
authored
Fetch Djot grammar dynamically instead of committing it (#96)
* Fetch Djot grammar dynamically instead of committing it - Add postinstall script to fetch grammar from djot-intellij - Add grammars directory to .gitignore - Remove stale local copy (workflow already fetches at build time) This ensures local development always uses the latest grammar from upstream, staying in sync with CI builds. * Add documentation site section to CONTRIBUTING.md
1 parent f99c6e5 commit 0873b07

4 files changed

Lines changed: 26 additions & 580 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121
/docs/node_modules/
2222
/docs/.vitepress/cache/
2323
/docs/.vitepress/dist/
24+
/docs/.vitepress/grammars/

CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,30 @@ public function testFeatureContains(): void
114114
}
115115
```
116116

117+
## Documentation Site
118+
119+
The documentation is built with [VitePress](https://vitepress.dev/).
120+
121+
### Local Development
122+
123+
```bash
124+
cd docs
125+
npm install # Fetches Djot grammar from djot-intellij automatically
126+
npm run docs:dev
127+
```
128+
129+
This starts a dev server at `http://localhost:5173/djot-php/` with hot reload.
130+
131+
The Djot syntax highlighting grammar is fetched from [djot-intellij](https://github.com/php-collective/djot-intellij) during `npm install` (via postinstall hook), ensuring you always have the latest version.
132+
133+
### Building
134+
135+
```bash
136+
cd docs
137+
npm run docs:build
138+
npm run docs:preview # Preview the build
139+
```
140+
117141
## Pull Request Guidelines
118142

119143
1. Create a feature branch from `master`

0 commit comments

Comments
 (0)