Use the sphinx_rtd_theme

This commit is contained in:
Michael DeHaan 2013-12-24 17:23:38 -05:00
parent 384cac7779
commit c88c3a40c6
3 changed files with 20 additions and 15 deletions

View file

@ -6,8 +6,6 @@ all: clean docs
docs: clean modules docs: clean modules
./build-site.py ./build-site.py
cp _static/* htmlout/_static/
cp _themes/solar/static/* htmlout/_static/
viewdocs: clean viewdocs: clean
./build-site.py view ./build-site.py view

View file

@ -5,12 +5,14 @@ This project hosts the source behind [ansibleworks.com/docs](http://www.ansiblew
Contributions to the documentation are welcome. To make changes, submit a pull request Contributions to the documentation are welcome. To make changes, submit a pull request
that changes the reStructuredText files in the "rst/" directory only, and Michael can that changes the reStructuredText files in the "rst/" directory only, and Michael can
do a docs build and push the static files. If you wish to verify output from the markup do a docs build and push the static files.
such as link references, you may [install Sphinx] and build the documentation by running
`make viewdocs` from the `ansible/docsite` directory. To include module documentation If you wish to verify output from the markup
you'll need to run `make webdocs` at the top level of the repository. The generated such as link references, you may install sphinx and build the documentation by running
html files are in docsite/htmlout/ and really won't be formatted right until up `make viewdocs` from the `ansible/docsite` directory.
on ansibleworks.com.
To include module documentation you'll need to run `make webdocs` at the top level of the repository. The generated
html files are in docsite/htmlout/.
If you do not want to learn the reStructuredText format, you can also [file issues] about If you do not want to learn the reStructuredText format, you can also [file issues] about
documentation problems on the Ansible GitHub project. documentation problems on the Ansible GitHub project.
@ -19,7 +21,8 @@ Note that module documentation can actually be [generated from a DOCUMENTATION d
in the modules directory, so corrections to modules written as such need to be made in the modules directory, so corrections to modules written as such need to be made
in the module source, rather than in docsite source. in the module source, rather than in docsite source.
[install Sphinx]: http://sphinx-doc.org/install.html To install sphinx and the required theme, install pip and then "pip install sphinx sphinx_rtd_theme"
[file issues]: https://github.com/ansible/ansible/issues [file issues]: https://github.com/ansible/ansible/issues
[module-docs]: http://www.ansibleworks.com/docs/developing_modules.html#documenting-your-module [module-docs]: http://www.ansibleworks.com/docs/developing_modules.html#documenting-your-module

View file

@ -16,13 +16,17 @@
import sys import sys
import os import os
# pip install sphinx_rtd_theme
import sphinx_rtd_theme
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# If your extensions are in another directory, add it here. If the directory # If your extensions are in another directory, add it here. If the directory
# is relative to the documentation root, use os.path.abspath to make it # is relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here. # absolute, like shown here.
#sys.path.append(os.path.abspath('some/directory')) #sys.path.append(os.path.abspath('some/directory'))
#
sys.path.insert(0, os.path.join('ansible', 'lib')) #sys.path.insert(0, os.path.join('ansible', 'lib'))
sys.path.append(os.path.abspath('_themes')) #sys.path.append(os.path.abspath('_themes'))
VERSION='0.01' VERSION='0.01'
AUTHOR='AnsibleWorks' AUTHOR='AnsibleWorks'
@ -100,14 +104,14 @@ pygments_style = 'sphinx'
# Options for HTML output # Options for HTML output
# ----------------------- # -----------------------
html_theme_path = ['_themes'] #html_theme_path = ['_themes']
html_theme = 'solar' html_theme = 'sphinx_rtd_theme'
html_short_title = 'Ansible Documentation' html_short_title = 'Ansible Documentation'
# The style sheet to use for HTML and HTML Help pages. A file of that name # The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths # must exist either in Sphinx' static/ path, or in one of the custom paths
# given in html_static_path. # given in html_static_path.
html_style = 'solar.css' #html_style = 'solar.css'
# The name for this set of Sphinx documents. If None, it defaults to # The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation". # "<project> v<release> documentation".