Permalink
Browse files

use new regime of nonsubmodule themes

  • Loading branch information...
1 parent 0cdf5ad commit 85f10579bc10279f5b52fc699b0c34baa5b5b243 @mcdonc mcdonc committed Dec 15, 2011
Showing with 34 additions and 17 deletions.
  1. +0 −2 .gitignore
  2. +2 −5 docs/Makefile
  3. +32 −10 docs/conf.py
View
@@ -11,5 +11,3 @@ dist/
.tox
nosetests.xml
pyramid_jinja2/coverage.xml
-docs/.build
-docs/_build/
View
@@ -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
@@ -83,6 +83,3 @@ epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) _build/epub
@echo
@echo "Build finished. The epub file is in _build/epub."
-
-_themes:
- cd ..; git submodule update --init; cd docs
View
@@ -20,16 +20,36 @@
import sys
import os
-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))
+# 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)
+
+ for item in os.listdir(parent):
+ if item.endswith('.egg'):
+ sys.path.append(os.path.join(parent, item))
# General configuration
# ---------------------
@@ -72,6 +92,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

0 comments on commit 85f1057

Please sign in to comment.