Skip to main content

Python web book docgen for Patchouli and Hex Casting.

Project description

hexdoc logo

Docs - hexdoc.hexxy.media PyPI - Version PyPI - Python Version GitHub Workflow Status (with event)

hexdoc

A Jinja-based documentation generator for Patchouli books.

This is the library that powers Hex Casting's web book.

Plugins

Creating a plugin / addon

WIP.

  • Run these commands, then follow the prompts:
    pip3 install cruft
    cruft create https://github.com/object-Object/hexdoc
    
    • --directory doc tells Cookiecutter to look for a template in the doc directory of hexdoc, and cannot be omitted.
    • If you run this from within an existing mod repo, add the flag -f, and leave the output_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 to Deploy from a branch, the branch to gh-pages, and the folder to docs/.
  • Commit and push the docgen, and see if the CI works.
  • On GitHub, under Settings > Environments, create two new environments called pypi and testpypi.
  • 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 the TestPyPI 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

Contributing

Setup

git submodule update --init

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://hexdoc.hexxy.media

Useful commands:

# show help
hexdoc -h

# render and serve the web book in watch mode
nodemon

# render and serve the web book
hexdoc serve

# export, render, and merge the web book
hexdoc export
hexdoc render
hexdoc merge

# start the Python interpreter with some extra local variables
hexdoc repl

# run tests
pytest  # fast, skips Cookiecutter
nox  # slow, full test suite in an isolated venv
nox --no-install  # after the first Nox run, use this to skip reinstalling everything

# update test snapshots
nox -- --snapshot-update

# run hexdoc commands in an isolated environment to ensure it works on its own
nox -s hexdoc -- export
nox -s hexdoc -- repl

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.dev2.tar.gz (91.6 kB view details)

Uploaded Source

Built Distribution

hexdoc-1!0.1.0.dev2-py3-none-any.whl (133.4 kB view details)

Uploaded Python 3

File details

Details for the file hexdoc-1!0.1.0.dev2.tar.gz.

File metadata

  • Download URL: hexdoc-1!0.1.0.dev2.tar.gz
  • Upload date:
  • Size: 91.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for hexdoc-1!0.1.0.dev2.tar.gz
Algorithm Hash digest
SHA256 8124f11fba1a281e198bbae1d20a280c26810b2ad0ed99e4e49d126f25ef4f6a
MD5 b79b2eb73ec3848329720a6c6a48d5ca
BLAKE2b-256 9d084f2704cd2b995ec0b144ea3c9a1cc7441ba30b63076f4b32fb137f6dc371

See more details on using hashes here.

File details

Details for the file hexdoc-1!0.1.0.dev2-py3-none-any.whl.

File metadata

File hashes

Hashes for hexdoc-1!0.1.0.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 8cfaf5277fe55e9dfd6329c39e6bfcd4f3953af0a8f17c13ebf899f2ebd3ce64
MD5 ed4d1a13e56336ce93852ece7b8c2881
BLAKE2b-256 8b10615c19a2d8110aa1d69370dd602ef9a82392574066929bda1e50dd26705d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page