Skip to content

Commit

Permalink
use newer-style git checkout of theme
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdonc committed Dec 15, 2011
1 parent cc0ddca commit da4523b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 15 deletions.
1 change: 1 addition & 0 deletions docs/.gitignore
@@ -1 +1,2 @@
_build/ _build/
_themes/
6 changes: 2 additions & 4 deletions docs/Makefile
Expand Up @@ -25,7 +25,7 @@ help:
clean: clean:
-rm -rf _build/* -rm -rf _build/*


html: _themes html:
mkdir -p _build/html _build/doctrees mkdir -p _build/html _build/doctrees
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html
@echo @echo
Expand All @@ -47,7 +47,7 @@ pickle:


web: pickle web: pickle


htmlhelp: _themes htmlhelp:
mkdir -p _build/htmlhelp _build/doctrees mkdir -p _build/htmlhelp _build/doctrees
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) _build/htmlhelp $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) _build/htmlhelp
@echo @echo
Expand Down Expand Up @@ -84,5 +84,3 @@ epub:
@echo @echo
@echo "Build finished. The epub file is in _build/epub." @echo "Build finished. The epub file is in _build/epub."


_themes:
for cd ..; git submodule update --init; cd docss
45 changes: 34 additions & 11 deletions docs/conf.py
Expand Up @@ -19,16 +19,36 @@


import sys, os import sys, os


parent = os.path.dirname(os.path.dirname(__file__)) # Add and use Pylons theme
sys.path.append(os.path.abspath(parent)) if 'sphinx-build' in ' '.join(sys.argv): # protect against dumb importers
wd = os.getcwd() from subprocess import call, Popen, PIPE
os.chdir(parent)
os.system('%s setup.py test -q' % sys.executable) p = Popen('which git', shell=True, stdout=PIPE)
os.chdir(wd) git = p.stdout.read().strip()

cwd = os.getcwd()
for item in os.listdir(parent): _themes = os.path.join(cwd, '_themes')
if item.endswith('.egg'):
sys.path.append(os.path.join(parent, item)) 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 # General configuration
# --------------------- # ---------------------
Expand Down Expand Up @@ -62,7 +82,7 @@
# other places throughout the built documents. # other places throughout the built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '0.8' version = '0.9'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = version release = version


Expand All @@ -79,6 +99,9 @@
# searched for source files. # searched for source files.
#exclude_dirs = [] #exclude_dirs = []


exclude_patterns = ['_themes/README.rst',]


# The reST default role (used for this markup: `text`) to use for all # The reST default role (used for this markup: `text`) to use for all
# documents. # documents.
#default_role = None #default_role = None
Expand Down

0 comments on commit da4523b

Please sign in to comment.