Skip to content

Instantly share code, notes, and snippets.

@jaceklaskowski
Last active April 23, 2021 06:33
Show Gist options
  • Save jaceklaskowski/5436018dac2c8d882080 to your computer and use it in GitHub Desktop.
Save jaceklaskowski/5436018dac2c8d882080 to your computer and use it in GitHub Desktop.
Writing docs using Sphinx (inside Docker)

Steps:

  • Build a Docker image and install sphinx inside
  • Run the image to have a complete working environment to create docs.

See https://github.com/subuser-security/subuser/blob/master/docs/Makefile.

Building jaceklaskowski/sphinx image

# Sphinx doc system containerized
#
# Heavily inspired by https://github.com/subuser-security/subuser/blob/master/docs/Makefile
FROM ubuntu:14.04.3

MAINTAINER Jacek Laskowski <jacek@japila.pl>

RUN apt-get update && apt-get install -y python-pip umlet pylint && pip install sphinx

CMD ["/bin/bash"]

Execute docker build -t jaceklaskowski/sphinx . in the directory with the Dockerfile above.

Start writing the docs

Execute docker run -ti --rm jaceklaskowski/sphinx and start writing the docs using Sphinx.

Create conf.py

conf.py = configuration file for Sphinx. Use https://github.com/subuser-security/subuser/blob/master/docs/conf.py as a reference.

Building the docs

Execute sphinx-build -b html . _build/html to generate HTML version of the docs into _build/html directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment