Skip to content

Commit 0eda82f

Browse files
committed
docs: add Zensical documentation site with versioned deployment
Set up a documentation website using Zensical (the actively maintained drop-in replacement for MkDocs, by the mkdocs-material team) with versioned docs deployed to GitHub Pages via squidfunk's mike fork. - Add zensical.toml with collapsible nav, light/dark toggle, search, and version switching via mike. - Add pyproject.toml for uv-managed Python dependencies (zensical, squidfunk/mike fork). Contributors preview docs with `uv run zensical serve`. - Add .github/workflows/docs.yml with two deployment paths: prerelease docs on push to main, versioned docs on GitHub release publication. Skipped on forks. - Split SETUP.md into installation.md (tabbed install options), editor-setup.md, and agent-setup.md for cleaner navigation. - Add docs/configuration.md as a dedicated config reference with complete tables for all config sections. - Add docs/benchmarks.md with comparison table and links to live latency and memory charts. - Add docs/index.md landing page with centered logo, key features, and version jump links. - Rename project-specific docs to lowercase (cli.md, configuration.md). - Fix all 25 broken anchor links in roadmap docs. - Fix missing 0.9.0 link reference in CHANGELOG.md. - Add roadmap sub-pages and benchmarks to navigation. - Add formatting.pint to config-schema.json (was missing from schema). - Add .github/PULL_REQUEST_TEMPLATE.md with contributor checklist. - Update DEFAULT_CONFIG_CONTENT with helpful comments and docs link. - Simplify README.md documentation section to link to docs site. - Update docs/CONTRIBUTING.md with docs build instructions. - Add site/ and .venv/ to .gitignore.
1 parent 37d6f78 commit 0eda82f

20 files changed

Lines changed: 1102 additions & 460 deletions

.github/workflows/docs.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/**'
8+
- 'zensical.toml'
9+
- 'pyproject.toml'
10+
- '.github/workflows/docs.yml'
11+
release:
12+
types: [published]
13+
workflow_dispatch:
14+
15+
permissions:
16+
contents: write
17+
18+
jobs:
19+
# Only deploy from the upstream repo, not from forks (forks don't
20+
# have write access to gh-pages and would fail).
21+
deploy-prerelease:
22+
if: github.repository_owner == 'PHPantom-dev' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v6
31+
32+
- name: Configure git
33+
run: |
34+
git config user.name "github-actions[bot]"
35+
git config user.email "github-actions[bot]@users.noreply.github.com"
36+
37+
- name: Deploy prerelease docs
38+
env:
39+
MKDOCS_SITE_NAME: "PHPantom Docs (prerelease)"
40+
MKDOCS_PRIMARY_COLOR: "blue grey"
41+
run: uv run -- mike deploy --push --update-aliases prerelease
42+
43+
deploy-release:
44+
if: github.repository_owner == 'PHPantom-dev' && github.event_name == 'release'
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
with:
49+
fetch-depth: 0
50+
51+
- name: Install uv
52+
uses: astral-sh/setup-uv@v6
53+
54+
- name: Configure git
55+
run: |
56+
git config user.name "github-actions[bot]"
57+
git config user.email "github-actions[bot]@users.noreply.github.com"
58+
59+
- name: Deploy versioned docs
60+
run: |
61+
version="${GITHUB_REF_NAME}"
62+
uv run -- mike deploy --push --update-aliases "$version" latest
63+
uv run -- mike set-default --push latest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ sandbox.php
99
examples/laravel/.codelite/laravel.session
1010
.codelite/
1111
examples/laravel/.codelite/
12+
/site/
13+
/.venv/

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,7 @@ PHPantom understands Composer projects out of the box, but works without setup o
9191

9292
## Documentation
9393

94-
- **[Installation & Configuration](docs/SETUP.md).** Editor setup, project configuration (`.phpantom.toml`), and formatting.
95-
- **[CLI Reference](docs/CLI.md).** Batch diagnostics (`analyze`), automated fixes (`fix`), and CI integration.
96-
- **[Building from Source](docs/BUILDING.md).** Build, test, and debug instructions.
97-
- **[Architecture](docs/ARCHITECTURE.md).** Symbol resolution, stub loading, and inheritance merging.
98-
- **[Contributing](docs/CONTRIBUTING.md)**
99-
- **[Changelog](docs/CHANGELOG.md)**
100-
- **Benchmarks.** [Latency](https://phpantom-dev.github.io/phpantom_lsp/dev/bench/) and [memory usage](https://phpantom-dev.github.io/phpantom_lsp/dev/memory/) tracked on every commit.
101-
- **[Roadmap](docs/todo.md).** Planned features and domain-specific plans.
94+
**[Read the docs](https://phpantom-dev.github.io/phpantom_lsp/)** -- installation, editor setup, configuration reference, CLI usage, benchmarks, and more.
10295

10396
## Acknowledgements
10497

docs/BUILDING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ RUST_LOG=debug cargo run 2>phpantom.log
6363

6464
Logs are written to stderr, so redirect as needed.
6565

66-
For editor setup instructions, see [SETUP.md](SETUP.md).
66+
For editor setup instructions, see [Editor Setup](editor-setup.md).

docs/CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3636

3737
### Removed
3838

39-
- **Bundled Zed extension.** PHPantom's plain-PHP wiring has merged into Zed's official PHP extension, so a separate PHPantom extension is no longer needed. See [SETUP.md](SETUP.md) for the updated Zed configuration.
39+
- **Bundled Zed extension.** PHPantom's plain-PHP wiring has merged into Zed's official PHP extension, so a separate PHPantom extension is no longer needed. See [Editor Setup](editor-setup.md) for the updated Zed configuration.
4040

4141
### Fixed
4242

@@ -824,7 +824,8 @@ Initial release.
824824
- **Embedded phpstorm-stubs.**
825825
- **Zed editor extension.**
826826

827-
[Unreleased]: https://github.com/PHPantom-dev/phpantom_lsp/compare/0.8.0...HEAD
827+
[Unreleased]: https://github.com/PHPantom-dev/phpantom_lsp/compare/0.9.0...HEAD
828+
[0.9.0]: https://github.com/PHPantom-dev/phpantom_lsp/compare/0.8.0...0.9.0
828829
[0.8.0]: https://github.com/PHPantom-dev/phpantom_lsp/compare/0.7.0...0.8.0
829830
[0.7.0]: https://github.com/PHPantom-dev/phpantom_lsp/compare/0.6.0...0.7.0
830831
[0.6.0]: https://github.com/PHPantom-dev/phpantom_lsp/compare/0.5.0...0.6.0

docs/CONTRIBUTING.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,39 @@ See [BUILDING.md](BUILDING.md) for more on running tests and manual LSP testing.
4545

4646
Update [CHANGELOG.md](CHANGELOG.md) when your PR adds, changes, or fixes something a user would notice. Add entries under `## [Unreleased]` in the appropriate subsection (`### Added`, `### Fixed`, `### Changed`, or `### Removed`). Write for end users, not developers: describe what changed in the editor, not which internal modules were touched. See the existing entries for the style and level of detail expected.
4747

48+
## Documentation
49+
50+
The documentation site is built with [Zensical](https://zensical.org/).
51+
The only dependency you need is [uv](https://docs.astral.sh/uv/getting-started/installation/).
52+
53+
Preview the docs locally with live reload:
54+
55+
```bash
56+
uv run zensical serve
57+
```
58+
59+
Then open `http://127.0.0.1:8000` in your browser. Changes to files in
60+
`docs/` and `zensical.toml` are reflected immediately. If port 8000 is
61+
already in use, pick a different one:
62+
63+
```bash
64+
uv run zensical serve -a 127.0.0.1:8200
65+
```
66+
67+
Build the docs for offline use:
68+
69+
```bash
70+
uv run zensical build
71+
```
72+
73+
The output is written to `site/` (gitignored). `uv` handles creating
74+
a virtual environment and installing all Python dependencies
75+
automatically on first run.
76+
4877
## Reporting Issues
4978

5079
Open an issue on GitHub with:
5180

5281
- What you expected to happen
5382
- What actually happened
54-
- Steps to reproduce (a minimal PHP snippet is ideal)
83+
- Steps to reproduce (a minimal PHP snippet is ideal)

0 commit comments

Comments
 (0)