Skip to content

Commit

Permalink
Use source and build directories for docs. Use rtd theme as default.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Massmann committed Jul 9, 2014
1 parent d460262 commit 214587d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ checkouts/
coverage/
develop-eggs/
dist/
docs/html/
docs/doctrees/
docs/build/
downloads/
eggs/
parts/
Expand Down
13 changes: 13 additions & 0 deletions buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ parts +=
i18ndude
node
omelette
rebuild_docs-sh
rebuild_i18n-sh
sphinxbuilder
zptlint
Expand Down Expand Up @@ -50,6 +51,17 @@ recipe = collective.recipe.omelette
eggs = ${instance:eggs}


[rebuild_docs-sh]
recipe = collective.recipe.template
input = inline:
#!/bin/bash
cd docs
make clean && make html
cd ..
output = ${buildout:directory}/bin/rebuild_docs.sh
mode = 755


[rebuild_i18n-sh]
recipe = collective.recipe.template
input = ${buildout:directory}/templates/rebuild_i18n.sh.in
Expand All @@ -61,6 +73,7 @@ mode = 755
recipe = collective.recipe.sphinxbuilder
eggs =
${instance:eggs}
sphinx_rtd_theme
sphinxcontrib-robotdoc
sphinxcontrib-httpdomain
source = ${buildout:directory}/docs
Expand Down
8 changes: 4 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = /Volumes/Work/Propertyshelf/Plone/Packages/ps.plone.mls/bin/sphinx-build
SPHINXBUILD = ../bin/sphinx-build
PAPER =
BUILDDIR = /Volumes/Work/Propertyshelf/Plone/Packages/ps.plone.mls/docs
BUILDDIR = build

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) /Volumes/Work/Propertyshelf/Plone/Packages/ps.plone.mls/docs
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) /Volumes/Work/Propertyshelf/Plone/Packages/ps.plone.mls/docs
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

Expand Down
6 changes: 3 additions & 3 deletions docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set BUILDDIR=/Volumes/Work/Propertyshelf/Plone/Packages/ps.plone.mls/docs
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% /Volumes/Work/Propertyshelf/Plone/Packages/ps.plone.mls/docs
set I18NSPHINXOPTS=%SPHINXOPTS% /Volumes/Work/Propertyshelf/Plone/Packages/ps.plone.mls/docs
set BUILDDIR=build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
set I18NSPHINXOPTS=%SPHINXOPTS% source
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
Expand Down
6 changes: 6 additions & 0 deletions docs/conf.py → docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import os
import sys

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand Down Expand Up @@ -104,6 +106,10 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
if not on_rtd:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
File renamed without changes.

0 comments on commit 214587d

Please sign in to comment.