Skip to content

Commit 33ef994

Browse files
migrate to Zensical for documentation
1 parent 8cf05a3 commit 33ef994

File tree

21 files changed

+507
-547
lines changed

21 files changed

+507
-547
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,9 @@ debug/
190190

191191
# End of https://www.toptal.com/developers/gitignore/api/rust,python
192192

193-
# mkdocs
193+
# mkdocs / zensical
194194
site/
195+
trace.json
195196

196197
# lsp-devtools db
197198
djls.db

.just/docs.just

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,89 @@ mkdoc_config := justfile_directory() + "/.mkdocs.yml"
77
default:
88
@just --list --justfile {{ justfile }}
99

10+
[private]
11+
[no-cd]
12+
copy:
13+
#!/usr/bin/env sh
14+
15+
{
16+
head -n 1 CHANGELOG.md
17+
sed -n '/^## \[Unreleased\]/,$p' CHANGELOG.md \
18+
| sed 's](docs/](]g'
19+
} > docs/changelog.md
20+
21+
cat CONTRIBUTING.md \
22+
| awk '
23+
/^> \[!NOTE\]/ {
24+
print "!!! note\n"
25+
in_admonition = 1
26+
next
27+
}
28+
in_admonition && /^> / {
29+
sub(/^> /, " ")
30+
print
31+
next
32+
}
33+
in_admonition && !/^> / {
34+
in_admonition = 0
35+
}
36+
/^<!-- \[\[\[cog/,/^\]\]\] -->$/ { next }
37+
/^<!-- \[\[\[end\]\]\] -->$/ { next }
38+
{ print }
39+
' \
40+
| sed 's](\./]\(https://github.com/joshuadavidthomas/django-language-server/tree/main/]g' \
41+
| sed 's](\([^h#:/][^)]*\))]\(https://github.com/joshuadavidthomas/django-language-server/tree/main/\1)]g' \
42+
> docs/contributing.md
43+
44+
{
45+
echo "---"
46+
echo "title: Home"
47+
echo "---"
48+
echo ""
49+
cat README.md \
50+
| awk '
51+
BEGIN { in_cog = 0; in_admonition = 0; past_header = 0 }
52+
/^# / && !past_header { past_header = 1; print; next }
53+
/^<!-- \[\[\[cog/ { in_cog = 1; next }
54+
in_cog && /^\]\]\] -->$/ { in_cog = 0; next }
55+
in_cog { next }
56+
/^<!-- \[\[\[end\]\]\] -->$/ { next }
57+
/img\.shields\.io/ { next }
58+
/^> \[!CAUTION\]/ {
59+
print "!!! warning\n"
60+
in_admonition = 1
61+
next
62+
}
63+
in_admonition && /^> / {
64+
sub(/^> /, " ")
65+
print
66+
next
67+
}
68+
in_admonition && !/^> / {
69+
in_admonition = 0
70+
}
71+
/^## Documentation$/ { exit }
72+
{ print }
73+
' \
74+
| sed 's](docs/](]g' \
75+
| sed 's](LICENSE)]\(https://github.com/joshuadavidthomas/django-language-server/tree/main/LICENSE)]g'
76+
} > docs/index.md
77+
1078
[private]
1179
fmt:
1280
@just --fmt --justfile {{ justfile }}
1381

1482
# Build documentation
1583
[no-cd]
16-
build LOCATION="site":
17-
uv run --group docs --frozen mkdocs build --config-file {{ mkdoc_config }} --site-dir {{ LOCATION }}
84+
build LOCATION="site": copy
85+
uv run --group docs --frozen zensical build --clean --config-file {{ mkdoc_config }}
1886

1987
# Serve documentation locally
2088
[no-cd]
21-
serve PORT="8000":
89+
serve PORT="8000": copy
2290
#!/usr/bin/env sh
2391
HOST="localhost"
2492
if [ -f "/.dockerenv" ]; then
2593
HOST="0.0.0.0"
2694
fi
27-
uv run --group docs --frozen mkdocs serve --config-file {{ mkdoc_config }} --dev-addr localhost:{{ PORT }}
95+
uv run --group docs --frozen zensical serve --config-file {{ mkdoc_config }} --dev-addr localhost:{{ PORT }}

.mkdocs.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json
2+
copyright: Copyright &copy; 2025 Josh Thomas
23
extra_css:
34
- stylesheets/extra.css
4-
hooks:
5-
- docs/hooks.py
65
markdown_extensions:
76
- attr_list
87
- admonition
8+
- md_in_html
99
- pymdownx.emoji:
1010
emoji_index: !!python/name:material.extensions.emoji.twemoji
1111
emoji_generator: !!python/name:material.extensions.emoji.to_svg
@@ -24,19 +24,37 @@ markdown_extensions:
2424
alternate_style: true
2525
combine_header_slug: true
2626
- pymdownx.tilde
27-
plugins:
28-
- search
29-
- include-markdown:
30-
rewrite_relative_urls: false
27+
- toc:
28+
permalink: true
29+
nav:
30+
- Home: index.md
31+
- Installation: installation.md
32+
- Configuration:
33+
- configuration/index.md
34+
- TagSpecs: configuration/tagspecs.md
35+
- Clients:
36+
- clients/index.md
37+
- Neovim: clients/neovim.md
38+
- Sublime Text: clients/sublime-text.md
39+
- VS Code: clients/vscode.md
40+
- Zed: clients/zed.md
41+
- Versioning: versioning.md
42+
- Changelog: changelog.md
43+
- Contributing: contributing.md
3144
repo_name: django-language-server
3245
repo_url: https://github.com/joshuadavidthomas/django-language-server
3346
site_author: joshuadavidthomas
3447
site_name: Django Language Server
35-
site_url: http://joshuadavidthomas.github.io/django-language-server
48+
site_url: https://djls.joshthomas.dev
3649
theme:
50+
custom_dir: docs/overrides
3751
features:
52+
- navigation.footer
53+
- navigation.indexes
3854
- navigation.instant
55+
- navigation.instant.prefetch
3956
- navigation.instant.progress
57+
- navigation.path
4058
- navigation.sections
4159
- navigation.tracking
4260
- search.highlight

CONTRIBUTING.md

Lines changed: 49 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ We adhere to Django's Code of Conduct in all interactions and expect all contrib
1010

1111
## Development
1212

13+
The project is written in Rust with IPC for Python communication. Here is a high-level overview of the project and the various crates:
14+
15+
- Main CLI interface ([`crates/djls/`](./crates/djls/))
16+
- Configuration management ([`crates/djls-conf/`](./crates/djls-conf/))
17+
- Django and Python project introspection ([`crates/djls-project/`](./crates/djls-project/))
18+
- LSP server implementation ([`crates/djls-server/`](./crates/djls-server/))
19+
- Template parsing ([`crates/djls-templates/`](./crates/djls-templates/))
20+
- Workspace and document management ([`crates/djls-workspace/`](./crates/djls-workspace/))
21+
22+
Code contributions are welcome from developers of all backgrounds. Rust expertise is valuable for the LSP server and core components, but Python and Django developers should not be deterred by the Rust codebase - Django expertise is just as valuable. Understanding Django's internals and common development patterns helps inform what features would be most valuable.
23+
24+
So far it's all been built by a [a simple country CRUD web developer](https://youtu.be/7ij_1SQqbVo?si=hwwPyBjmaOGnvPPI&t=53) learning Rust along the way - send help!
25+
1326
### Version Updates
1427

1528
#### Python
@@ -27,59 +40,59 @@ The project uses [`noxfile.py`](noxfile.py) as the single source of truth for su
2740

2841
1. Update [`noxfile.py`](noxfile.py), adding or removing version constants as needed and updating the `PY_VERSIONS` list accordingly.
2942

30-
For example, given the following versions:
43+
For example, given the following versions:
3144

32-
```python
33-
PY39 = "3.9"
34-
PY310 = "3.10"
35-
PY311 = "3.11"
36-
PY312 = "3.12"
37-
PY313 = "3.13"
38-
PY_VERSIONS = [PY39, PY310, PY311, PY312, PY313]
39-
```
45+
```python
46+
PY39 = "3.9"
47+
PY310 = "3.10"
48+
PY311 = "3.11"
49+
PY312 = "3.12"
50+
PY313 = "3.13"
51+
PY_VERSIONS = [PY39, PY310, PY311, PY312, PY313]
52+
```
4053

41-
To add Python 3.14 and remove Python 3.9, the final list will be:
54+
To add Python 3.14 and remove Python 3.9, the final list will be:
4255

43-
```python
44-
PY310 = "3.10"
45-
PY311 = "3.11"
46-
PY312 = "3.12"
47-
PY313 = "3.13"
48-
PY314 = "3.14"
49-
PY_VERSIONS = [PY310, PY311, PY312, PY313, PY314]
50-
```
56+
```python
57+
PY310 = "3.10"
58+
PY311 = "3.11"
59+
PY312 = "3.12"
60+
PY313 = "3.13"
61+
PY314 = "3.14"
62+
PY_VERSIONS = [PY310, PY311, PY312, PY313, PY314]
63+
```
5164

5265
2. Regenerate auto-generated content:
5366

54-
```bash
55-
just cog
56-
```
67+
```bash
68+
just cog
69+
```
5770

58-
This updates:
71+
This updates:
5972

60-
- The `requires-python` field in [`pyproject.toml`](pyproject.toml)
61-
- Python version trove classifiers in [`pyproject.toml`](pyproject.toml)
62-
- Supported versions list in [`README.md`](README.md)
73+
- The `requires-python` field in [`pyproject.toml`](pyproject.toml)
74+
- Python version trove classifiers in [`pyproject.toml`](pyproject.toml)
75+
- Supported versions list in [`README.md`](README.md)
6376

6477
3. Update the lock file:
6578

66-
```bash
67-
uv lock
68-
```
79+
```bash
80+
uv lock
81+
```
6982

7083
4. Test the changes:
7184

72-
```bash
73-
just testall
74-
```
85+
```bash
86+
just testall
87+
```
7588

76-
Use `just testall` rather than `just test` to ensure all Python versions are tested. The `just test` command only runs against the default versions (the oldest supported Python and Django LTS) and won't catch issues with newly added versions.
89+
Use `just testall` rather than `just test` to ensure all Python versions are tested. The `just test` command only runs against the default versions (the oldest supported Python and Django LTS) and won't catch issues with newly added versions.
7790

78-
If you want, you can also test only a specific Python version across all Django versions by `nox` directly:
91+
If you want, you can also test only a specific Python version across all Django versions by `nox` directly:
7992

80-
```bash
81-
nox --python 3.14 --session tests
82-
```
93+
```bash
94+
nox --python 3.14 --session tests
95+
```
8396

8497
5. Update [`CHANGELOG.md`](CHANGELOG.md), adding entries for any versions added or removed.
8598

0 commit comments

Comments
 (0)