Skip to content

winhamwr/sphinx-to-github

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sphinx to GitHub

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.

How?

The sphinxtogithub.py script can be run on the command line or used as a Sphinx extension.

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.

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

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, to Georg Brandl for Sphinx and the github crew for the pages functionality.

About

Script to prepare Sphinx html output for github pages.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%