Skip to content

Instantly share code, notes, and snippets.

@blaflamme
Created November 27, 2011 17:00
Show Gist options
  • Save blaflamme/1397824 to your computer and use it in GitHub Desktop.
Save blaflamme/1397824 to your computer and use it in GitHub Desktop.
Pyramid documentation sphinx theme update
# 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'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment