Python web book docgen for Patchouli and Hex Casting.
Project description
hexdoc
A Jinja-based documentation generator for Patchouli books.
This is the library that powers Hex Casting's web book.
Creating a plugin / addon
WIP.
- Run these commands, then follow the prompts:
pip3 install cruft cruft create gh:object-Object/hexdoc --directory doc
--directory doc
tells Cookiecutter to look for a template in thedoc
directory of hexdoc, and cannot be omitted.- If you run this from within an existing mod repo, add the flag
-f
, and leave theoutput_directory
option blank when prompted by Cookiecutter.- Note: this currently overwrites any conflicting files, including your .gitignore, so you may need to use your Git history to re-add anything not covered by the new file.
- Fill in the TODOs in
doc/hexdoc.toml
(mostly paths to files/folders in your mod so hexdoc can find the data it needs). - Try running the docgen locally by following the instructions in
doc/README.md
. - If it doesn't already exist, create an empty
gh-pages
branch and push it. - On GitHub, under
Settings > Pages
, set the source toDeploy from a branch
, the branch togh-pages
, and the folder todocs/
. - Commit and push the docgen, and see if the CI works.
- On GitHub, under
Settings > Environments
, create two new environments calledpypi
andtestpypi
. - Follow these instructions for PyPI and TestPyPI: https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/
- TestPyPI is a duplicate of PyPI which can be used for testing package publishing without affecting the real index. The CI workflow includes a manual execution option to publish to TestPyPI.
- If you like to live dangerously, this step is optional - you can remove the
publish-testpypi
job and theTestPyPI
release choice from your workflow without impacting the rest of the CI.
Updating to the latest Cookiecutter template
Run this command: cruft update
See also: https://cruft.github.io/cruft/#updating-a-project
Setup
python3.11 -m venv venv
.\venv\Scripts\activate # Windows
. venv/bin/activate.fish # fish
source venv/bin/activate # everything else
pip install -e .[dev]
pre-commit install
Usage
For local testing, create a file called .env
in the repo root following this template:
GITHUB_SHA=main
GITHUB_REPOSITORY=object-Object/hexdoc
GITHUB_PAGES_URL=https://object-object.github.io/hexdoc
Then run these commands to generate the book:
hexdoc render
hexdoc merge
Or, run this command to render the book and start a local web server:
hexdoc serve --lang en_us
Nodemon is also configured.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hexdoc-1!0.1.0.dev0.tar.gz
(328.7 kB
view details)
Built Distribution
hexdoc-1!0.1.0.dev0-py3-none-any.whl
(371.0 kB
view details)
File details
Details for the file hexdoc-1!0.1.0.dev0.tar.gz
.
File metadata
- Download URL: hexdoc-1!0.1.0.dev0.tar.gz
- Upload date:
- Size: 328.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5db0787a76f14f629f24d580994c9bbc71b3c668cd3255cd1f75e43ea596ba1 |
|
MD5 | 8b7494c05e2eef24c85f7738e48dba14 |
|
BLAKE2b-256 | 51b31f32eb281a509883882b381756deac4745e9025dd5c3c576045f6b7264ca |
File details
Details for the file hexdoc-1!0.1.0.dev0-py3-none-any.whl
.
File metadata
- Download URL: hexdoc-1!0.1.0.dev0-py3-none-any.whl
- Upload date:
- Size: 371.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69b04a237caee8cda95c9536f2eefb64003de1696cb08853f49aab5b197b3e36 |
|
MD5 | bda467b5778e976e6707b976edd699db |
|
BLAKE2b-256 | 48c41b200bc2bea184a6a067a8a59398e167cd0566a165db75a44740a3839f1f |