Script for preparing the html output of the Sphinx documentation system for github pages.
Project description
A Python script for preparing the html output of the Sphinx documentation system for github pages.
It renames any top level folders which start with an underscore and edits any references to them within the html files.
Why?
GitHub processes the incoming html with Jekyll which believes top level folders starting with an underscore are special and does not let their content be accessible to the server. This is incompatible with Sphinx which uses underscores at the start of folder names for static content.
Usage
The sphinxtogithub.py script can be run on the command line or used as a Sphinx extension.
Extension
Place the script on the PYTHONPATH and add sphinxtogithub to the extensions list in the conf.py file in your Sphinx project:
extensions = [ "sphinxtogithub" ]
Additionally there are two config variables you can use to control the extension. The first enables/disables the extension and the second enables verbose output. They are True by default:
sphinx_to_github = True sphinx_to_github_verbose = True
Command Line
Run the script with the path to the html output directory as the first argument. There is a --verbose flag for basic output.
Further Information
Install from GitHub
It should be possible to install this tool directly from github using pip:
pip install -e git+git://github.com/michaeljones/sphinx-to-github.git#egg=sphinx-to-github
Thanks to winhamwr’s work.
Requirements
The script uses /usr/bin/env and python.
Running Tests
Unit tests can be run using the setuptools test target. eg:
$ python setup.py test
Alternatives
dinoboff’s project github-tools provides similar functionality combined with a much more comprehensive set of tools for helping you to manage Python based projects on github.
Credits
Thank you to:
For their contributions, which are beginning to outweigh mine, to Georg Brandl for Sphinx and the github crew for the pages functionality.
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
File details
Details for the file sphinxtogithub-1.0.0.tar.gz
.
File metadata
- Download URL: sphinxtogithub-1.0.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71e191b38defcfcff4acd918190a6322d8b7374fe84b97b6bc17d74c550c5759 |
|
MD5 | 675891b2505e7ea79d331d35ffce3a5f |
|
BLAKE2b-256 | 42fe9112d752a0329c74faf8e00afd1ef84dcab395ff70e66d711dd06358e7a1 |