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.

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 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

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 hashes)

Uploaded Source

Built Distribution

hexdoc-1!0.1.0.dev0-py3-none-any.whl (371.0 kB view hashes)

Uploaded Python 3

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