Permalink
Browse files

added an rtd hack to update the themes submodule

  • Loading branch information...
1 parent a94226a commit 4996bb5694fc8c280ac247e8e371b90315c8edb5 @blaflamme blaflamme committed May 6, 2012
Showing with 15 additions and 3 deletions.
  1. +3 −3 Makefile
  2. +12 −0 conf.py
View
@@ -25,7 +25,7 @@ help:
clean:
-rm -rf _build/*
-html: themes
+html: _themes
mkdir -p _build/html _build/doctrees
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html
@echo
@@ -41,7 +41,7 @@ pickle:
web: pickle
-htmlhelp: themes
+htmlhelp: _themes
mkdir -p _build/htmlhelp _build/doctrees
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) _build/htmlhelp
@echo
@@ -69,5 +69,5 @@ linkcheck:
@echo "Link check complete; look for any errors in the above output " \
"or in _build/linkcheck/output.txt."
-themes:
+_themes:
git submodule update --init
View
12 conf.py
@@ -88,6 +88,18 @@
# Options for HTML output
# -----------------------
+if 'sphinx-build' in ' '.join(sys.argv): # protect against dumb importers
+ from subprocess import call, Popen, PIPE
+
+ cwd = os.getcwd()
+ _themes = os.path.join(cwd, '_themes')
+ p = Popen('which git', shell=True, stdout=PIPE)
+ git = p.stdout.read().strip()
+ if not os.listdir(_themes):
+ call([git, 'submodule', '--init'])
+ else:
+ call([git, 'submodule', 'update'])
+
# Add and use Pylons theme
sys.path.append(os.path.abspath('_themes'))
html_theme_path = ['_themes']

0 comments on commit 4996bb5

Please sign in to comment.