Skip to content

Commit

Permalink
added an rtd hack to update the themes submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
blaflamme committed May 6, 2012
1 parent b51043a commit 5bbb2d6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,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']
Expand Down

0 comments on commit 5bbb2d6

Please sign in to comment.