Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use checkout rather than submodule for docs theme

  • Loading branch information...
commit 5a664154c724a9b0d32e3d150bf31eeb1782bb33 1 parent 018fe78
@mcdonc mcdonc authored
Showing with 53 additions and 19 deletions.
  1. +2 −0  .gitignore
  2. +3 −5 docs/Makefile
  3. +48 −14 docs/conf.py
View
2  .gitignore
@@ -19,3 +19,5 @@ pypyenv/
build/
dist/
peppercorn/coverage.xml
+docs/_build
+docs/_themes
View
8 docs/Makefile
@@ -2,7 +2,7 @@
#
# You can set these variables from the command line.
-SPHINXOPTS =
+SPHINXOPTS = -W
SPHINXBUILD = sphinx-build
PAPER =
@@ -25,7 +25,7 @@ help:
clean:
-rm -rf _build/*
-html: _themes
+html:
mkdir -p _build/html _build/doctrees
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html
@echo
@@ -47,7 +47,7 @@ pickle:
web: pickle
-htmlhelp: _themes
+htmlhelp:
mkdir -p _build/htmlhelp _build/doctrees
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) _build/htmlhelp
@echo
@@ -84,5 +84,3 @@ epub:
@echo
@echo "Build finished. The epub file is in _build/epub."
-_themes:
- cd ..; git submodule update --init; cd docs
View
62 docs/conf.py
@@ -14,22 +14,57 @@
import sys, os
+# Add and use Pylons theme
+if 'sphinx-build' in ' '.join(sys.argv): # protect against dumb importers
+ from subprocess import call, Popen, PIPE
+
+ p = Popen('which git', shell=True, stdout=PIPE)
+ git = p.stdout.read().strip()
+ cwd = os.getcwd()
+ _themes = os.path.join(cwd, '_themes')
+
+ if not os.path.isdir(_themes):
+ call([git, 'clone', 'git://github.com/Pylons/pylons_sphinx_theme.git',
+ '_themes'])
+ else:
+ os.chdir(_themes)
+ call([git, 'checkout', 'master'])
+ call([git, 'pull'])
+ os.chdir(cwd)
+
+ sys.path.append(os.path.abspath('_themes'))
+
+ parent = os.path.dirname(os.path.dirname(__file__))
+ sys.path.append(os.path.abspath(parent))
+ wd = os.getcwd()
+ os.chdir(parent)
+ os.system('%s setup.py test -q' % sys.executable)
+ os.chdir(wd)
+
+ parent = os.path.dirname(os.path.dirname(__file__))
+ sys.path.append(os.path.abspath(parent))
+ wd = os.getcwd()
+ os.chdir(parent)
+ os.system('%s setup.py test -q' % sys.executable)
+ os.chdir(wd)
+
+ for item in os.listdir(parent):
+ if item.endswith('.egg'):
+ sys.path.append(os.path.join(parent, item))
+
+html_theme_path = ['_themes']
+html_theme = 'pylons'
+html_theme_options = dict(
+ github_url='https://github.com/Pylons/peppercorn',
+# in_progress='true'
+ )
+
+
# 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 absolute, like shown here.
#sys.path.append(os.path.abspath('some/directory'))
-parent = os.path.dirname(os.path.dirname(__file__))
-sys.path.append(os.path.abspath(parent))
-wd = os.getcwd()
-os.chdir(parent)
-os.system('%s setup.py test -q' % sys.executable)
-os.chdir(wd)
-
-for item in os.listdir(parent):
- if item.endswith('.egg'):
- sys.path.append(os.path.join(parent, item))
-
# General configuration
# ---------------------
@@ -71,6 +106,8 @@
# searched for source files.
#exclude_dirs = []
+exclude_patterns = ['_themes/README.rst',]
+
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
@@ -93,9 +130,6 @@
# Options for HTML output
# -----------------------
-sys.path.append(os.path.abspath('_themes'))
-html_theme_path = ['_themes']
-html_theme = 'pylons'
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.