• This repository has been archived on 08/Jul/2023
  • Stars
    star
    104
  • Rank 328,644 (Top 7 %)
  • Language
    Python
  • License
    Other
  • Created over 15 years ago
  • Updated about 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sphinx extension & script to prepare Sphinx html output for github pages.

Sphinx to GitHub

ATTENTION!

This project is designed to help you get around the github-pages Jekyll behaviour of ignoring top level directories starting with an underscore.

This is solved in a much neater way by creating a .nojekyll in the root of you github-pages which will disable Jekyll as described here and here.

This makes this project largely useless! Thank you to acdha for making me aware of this.

What?

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 three config variables you can use to control the extension. The first enables/disables the extension, the second enables verbose output and the third determines the encoding which is used to read & write files. The first two are True by default and the third is set to utf-8:

sphinx_to_github = True
sphinx_to_github_verbose = True
sphinx_to_github_encoding = "utf-8"

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.

More Repositories

1

packed

JSX-style syntax preprocessor for Python
Python
87
star
2

on-commit-messages

69
star
3

matcha

🍵 A template system for Gleam
Rust
63
star
4

gleam-phoenix-mix

Demonstration project for getting using gleam inside a mix/elixir project
Elixir
30
star
5

alembic-fs

Fuse filesystem for Alembic files
C++
20
star
6

elm-parser

A parser for the Elm language written in Rust using the nom library
Rust
16
star
7

mango

Toy experiment of a text editing node graph in Rust
Rust
15
star
8

houdini-particleviewer

OpenGL display hooks for particles in houdini
C++
15
star
9

rada

A Gleam package for dates
Gleam
10
star
10

elm-message-format-experiment

An attempt to provide i18n workflow using the npm messageformat package
JavaScript
8
star
11

wake

Pipeline and Workflow tool
Python
7
star
12

maya-plugin-handler

C++ helper classes to reduce code duplication between initializePlugin & uninitializePlugin
C++
5
star
13

elm-manchester-resources

List of resources for the Elm Manchester meetup
5
star
14

gcc-highlight

Terminal highlighting for g++ output
Python
5
star
15

community-bot

Helper bot for managing Github projects as a community
JavaScript
4
star
16

elm-make-server

An experiment to only have one instance of elm-make running at once
JavaScript
4
star
17

kdtree

C++ implementation of a kdtree
C
3
star
18

gleam-javascript-example

JavaScript
3
star
19

curl-noise

Simple implementation of curl noise
C++
3
star
20

sphinx-xref

Restructured text role for keyword based external links
Python
3
star
21

sphinx-anode

Image annotation directives for restructured text
Python
2
star
22

erm

Rust
2
star
23

dotfiles

User config files
Tcl
2
star
24

flock

A basic flocking system in C++
C++
2
star
25

dashboard

A dashboard/timeline for viewing activity across multiple repositories
Elixir
2
star
26

seinfeld

Seinfeld calendar as a standalone javascript webpage
JavaScript
1
star
27

exercise-timer

Exercise timer
Elm
1
star
28

maya-assist

A library for simplifying working with parts of the Autodesk Maya API
C++
1
star
29

sph

Simple implementation of smoothed particle hydrodynamics
C++
1
star
30

mix-reorganize

A mix task to reorganise files into 'domain' folders
Elixir
1
star
31

porter

A map-based import hook for Python
Python
1
star
32

hangman-live-coding

Code from live coding hangman at Lambda Lounge
Elm
1
star
33

proportional-representation

Notes on Proportional Representation
JavaScript
1
star