|
| 1 | +# practical-python.org |
| 2 | + |
| 3 | +The website and documentation space for the Practical Python Discord community. |
| 4 | + |
| 5 | +Built with [Zensical](https://zensical.org/) |
| 6 | + |
| 7 | +## Quick start |
| 8 | + |
| 9 | +**Prerequisites:** [uv](https://docs.astral.sh/uv/getting-started/installation/). |
| 10 | +It fetches the right Python for you, so that's the only thing to install. |
| 11 | + |
| 12 | +```bash |
| 13 | +uv sync |
| 14 | +uv run zensical serve |
| 15 | +``` |
| 16 | + |
| 17 | +That serves the site at `http://127.0.0.1:8000` and rebuilds when you save a |
| 18 | +file. |
| 19 | + |
| 20 | +## Checking your work before you push |
| 21 | + |
| 22 | +```bash |
| 23 | +uv run zensical build --strict |
| 24 | +``` |
| 25 | + |
| 26 | +Broken internal links and dead anchors are build failures, not warnings. CI runs |
| 27 | +the same command, so if it passes here it passes there. |
| 28 | + |
| 29 | +Install the git hooks once and you'll get that check automatically on every |
| 30 | +commit: |
| 31 | + |
| 32 | +```bash |
| 33 | +uv run --dev pre-commit install |
| 34 | +``` |
| 35 | + |
| 36 | +To run every check by hand: |
| 37 | + |
| 38 | +```bash |
| 39 | +uv run --dev pre-commit run --all-files |
| 40 | +``` |
| 41 | + |
| 42 | +## Layout |
| 43 | + |
| 44 | +```text |
| 45 | +docs/ |
| 46 | +├── index.md landing page |
| 47 | +├── CNAME custom domain, copied to the site root on build |
| 48 | +├── stylesheets/ colour, font and hero overrides |
| 49 | +├── getting-started/ the entry point for new members |
| 50 | +├── rules/ server rules, code of conduct, moderation |
| 51 | +├── resources/ learning material and setup guides |
| 52 | +└── projects/ |
| 53 | + ├── our-projects/ software the community maintains |
| 54 | + └── build-something/ project challenges for members |
| 55 | +scripts/ |
| 56 | +└── refresh_member_count.py updates the Discord member count before a deploy build |
| 57 | +zensical.toml all site configuration, including the nav |
| 58 | +``` |
| 59 | + |
| 60 | +## Adding a page |
| 61 | + |
| 62 | +1. Create the Markdown file under the right folder in `docs/`. |
| 63 | +2. Add it to the `nav` list in `zensical.toml`. |
| 64 | + |
| 65 | +Step 2 isn't optional. Zensical can derive navigation from the folder structure, |
| 66 | +but that sorts alphabetically and would put Projects ahead of Rules, so the nav |
| 67 | +is written out. |
| 68 | + |
| 69 | +[CONTRIBUTING.md](CONTRIBUTING.md) covers the writing conventions, which matter |
| 70 | +more than the mechanics. |
| 71 | + |
| 72 | +## Deployment |
| 73 | + |
| 74 | +Merging to `main` triggers `.github/workflows/deploy.yml`, which builds with |
| 75 | +`--strict` and publishes to GitHub Pages. |
| 76 | + |
| 77 | +Pull requests run `.github/workflows/ci.yml` — the same pre-commit checks you get |
| 78 | +locally. |
| 79 | + |
| 80 | +## Dependencies |
| 81 | + |
| 82 | +One direct dependency, `zensical`, pinned through `uv.lock`. `requirements.txt` is |
| 83 | +generated from the lockfile for anyone who wants to read the tree without uv: |
| 84 | + |
| 85 | +```bash |
| 86 | +uv export --no-dev --no-hashes --no-emit-project -o requirements.txt |
| 87 | +``` |
| 88 | + |
| 89 | +CI installs from the lockfile, not from `requirements.txt`. |
0 commit comments