Permalink
Browse files

gh-pages.py no longer updates index.rst

  • Loading branch information...
1 parent 33e87e7 commit 5285c57793f098eba06d1e8fbde55a4e50ced8b9 @minrk minrk committed Feb 15, 2011
Showing with 6 additions and 44 deletions.
  1. +0 −4 docs/Makefile
  2. +1 −37 docs/gh-pages.py
  3. +5 −3 docs/source/development/doc_guide.txt
View
@@ -105,7 +105,3 @@ nightly: dist
gh-pages: html pdf
python gh-pages.py
-
-gh-pages-current: html pdf
- ipver="$(ipython -v 2>&1)"
- python gh-pages.py dev "Current Development Version ($ipver)"
View
@@ -74,34 +74,6 @@ def init_repo(path):
sh('git checkout gh-pages')
cd(here)
-
-def render_rstindex(fname, tag, desc=None):
- if desc is None:
- desc = tag
-
- rel = '* {d}: `HTML <{t}/index.html>`_ and `PDF <{t}/ipython.pdf>`_.'.format(t=tag,d=desc)
- rep = re.compile(r'\.\. release')
- out = []
- with file(fname) as f:
- contents = f.read()
- lines = contents.splitlines()
- if rel in contents:
- out = lines
- else:
- for line in lines:
- out.append(line)
- if rep.search(line):
- out.append(rep.sub(rel, line))
- return '\n'.join(out)+'\n'
-
-
-def new_rstindex(fname, tag, desc=None):
- new_page = render_rstindex(fname, tag, desc)
- os.rename(fname, fname+'~')
- with file(fname, 'w') as f:
- f.write(new_page)
-
-
#-----------------------------------------------------------------------------
# Script starts
#-----------------------------------------------------------------------------
@@ -115,11 +87,6 @@ def new_rstindex(fname, tag, desc=None):
except CalledProcessError:
tag = "dev" # Fallback
- try:
- desc = sys.argv[2]
- except IndexError:
- desc="Release (%s)"%tag
-
startdir = os.getcwd()
if not os.path.exists(pages_dir):
# init the repo
@@ -152,10 +119,7 @@ def new_rstindex(fname, tag, desc=None):
raise RuntimeError(e)
sh('git add %s' % tag)
- new_rstindex('index.rst', tag, desc)
- sh('python build_index.py')
- sh('git add index.rst index.html')
- sh('git commit -m"Created new doc release, named: %s"' % tag)
+ sh('git commit -m"Updated doc release: %s"' % tag)
print
print 'Most recent 3 commits:'
sys.stdout.flush()
@@ -149,12 +149,14 @@ they're automatically exposed as a website. It works like this:
version of the docs repository, copy the built docs into it, and commit your
changes.
* Open the built docs in a web browser, and check that they're as expected.
-* (If rebuilding the docs for the development version, it may have duplicated
- the link to the development version in the homepage. Remove this from
- index.rst, then run ``python build_index.py`` to update index.html. Commit the
+* (When building the docs for a new tagged release, you will have to add its link to
+ index.rst, then run ``python build_index.py`` to update index.html. Commit the
change.)
* Upload the docs with ``git push``. This only works if you have write access to
the docs repository.
+* If you are building a version that is not the current dev branch, nor a tagged release,
+ then you must run gh-pages.py directly with ``python gh-pages.py <version>``, and *not*
+ with ``make gh-pages``.
.. [reStructuredText] reStructuredText. http://docutils.sourceforge.net/rst.html
.. [Sphinx] Sphinx. http://sphinx.pocoo.org/

0 comments on commit 5285c57

Please sign in to comment.