Skip to main content

sphinx-ape: Build Sphinx Documentation for ApeWorX plugins

Project description

Quick Start

sphinx-ape is a documentation plugin for the Sphinx framework. The purpose of this plugin to share code for generating documentation across all ApeWorX repositories.

Dependencies

Install

Install the package from GitHub:

pip install git+https://github.com/ApeWorX/sphinx-ape.git@main

NOTE: Also, you may clone and the package first and install locally.

Try sphinx-ape --help to check if it's installed.

Quick Usage

To use this sphinx plugin, first generate the docs structure (ran from your project directory):

sphinx-ape init .

It will have generated a docs/ folder with some necessary config file in it, along with a quick-start that links to your README.md.

Now, you can begin writing your Sphinx documentation. There are three directories you can place documentation sources in:

  1. userguides/ - a directory containing how-to guides for how to use your package.
  2. commands/ - .rst files for the sphinx-click plugin for CLI-based references.
  3. methoddocs/ - Autodoc .rst files controlling your generated method documentation.

Once you have developed your documentation, ensure you have sphinx-ape installed. For example, clone this repo and install it using pip install <path/to/sphinx-ape> or install from pypi by doing pip intall sphinx-ape.

After sphinx-ape is installed, build your projects' documentation by doing:

sphinx-ape build <path/to/project>

Most commonly, you will already be in your project's directory, so you will do:

sphinx-ape build .

Then, to view the documentation, run the serve command:

sphinx-ape serve <path/to/project>
# When in directory already
sphinx-ape serve .

To automatically open a browser at the same time as serving, use the --open flag:

sphinx-ape serve . --open

To run your doc-tests, use the sphinx-ape test command:

sphinx-ape test .

GitHub Action

This GitHub action is meant for building the documentation in both core Ape as well any Ape plugin. The aciton may also work for regular Python packages with a documentation-strategy similar to Ape.

There are three GitHub events that trigger this action:

  1. Push to 'main': we build into 'latest/'. The GitHub action will commit these changes to the 'gh-pages' branch.

  2. Release: we copy 'latest/' into the release dir, as well as to 'stable/'. The GitHub action will commit these changes to the 'gh-pages' branch.

  3. Pull requests or local development: We ensure a successful build.

GitHub Pages

To set up this action with GitHub pages for the release-workflow to work, first create a branch named gh-pages and push it to GitHub. Then, delete everything besides a simple README.md, the .gitignore file, and the LICENSE file. Once that is all pushed, verify on the Pages tab that a site was made for you. Now, on merges to main and releases, this site should be updated (if you are using the action).

To publish the docs locally, use the publish command:

sphinx-ape publish .

Development

Please see the contributing guide to learn more how to contribute to this project. Comments, questions, criticisms and pull requests are welcomed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx-ape-0.1.0a0.tar.gz (66.7 kB view details)

Uploaded Source

Built Distribution

sphinx_ape-0.1.0a0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file sphinx-ape-0.1.0a0.tar.gz.

File metadata

  • Download URL: sphinx-ape-0.1.0a0.tar.gz
  • Upload date:
  • Size: 66.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for sphinx-ape-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 70dcd18546502f4c1e6b87d1dfb8df1254fb8aff73939084e7b2e310f643b99f
MD5 1b6a7bb688a8168256bfcb7d59a4dfbf
BLAKE2b-256 808a0a36fa9159ffcaca2b38fac842897c21bc565f3aa3fa954f54486a2478b6

See more details on using hashes here.

File details

Details for the file sphinx_ape-0.1.0a0-py3-none-any.whl.

File metadata

  • Download URL: sphinx_ape-0.1.0a0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for sphinx_ape-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 532d3bcc5b9f8be2601c51a533dfc05990936a20c7e3dbd3a67b07000446609b
MD5 45fe47d325340163fbde51e5e7ee82ab
BLAKE2b-256 3544ba6321457d8291c5f388874ceba0dda217d2137f9a4f66f773ff63033fdf

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