Permalink
Browse files

updated doc theme workflow

  • Loading branch information...
blaflamme committed Nov 27, 2011
1 parent 1ea8938 commit 477f51b6e04e5b2e6c2d30ce8c9884eb08516e92
Showing with 21 additions and 8 deletions.
  1. +0 −3 .gitmodules
  2. +2 −4 docs/Makefile
  3. +0 −1 docs/_themes
  4. +19 −0 docs/conf.py
View
@@ -1,3 +0,0 @@
-[submodule "docs/_themes"]
- path = docs/_themes
- url = git://github.com/Pylons/pylons_sphinx_theme.git
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
@@ -84,5 +84,3 @@ epub:
@echo
@echo "Build finished. The epub file is in _build/epub."
-_themes:
- cd ..; git submodule update --init; cd docs
Submodule _themes deleted from 03e5e5
View
@@ -141,9 +141,28 @@ def nothing(*arg):
# -----------------------
# Add and use Pylons theme
+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'))
html_theme_path = ['_themes']
html_theme = 'pyramid'
+html_theme_options = dict(
+ github_url='https://github.com/Pylons/pyramid'
+ )
# 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

0 comments on commit 477f51b

Please sign in to comment.