diff --git a/docs/Makefile b/docs/Makefile index bb0c365..31a9d21 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -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)" diff --git a/docs/gh-pages.py b/docs/gh-pages.py index 8359215..0050841 100755 --- a/docs/gh-pages.py +++ b/docs/gh-pages.py @@ -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 @@ if __name__ == '__main__': 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 @@ if __name__ == '__main__': 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() diff --git a/docs/source/development/doc_guide.txt b/docs/source/development/doc_guide.txt index dee8dcf..d49b102 100644 --- a/docs/source/development/doc_guide.txt +++ b/docs/source/development/doc_guide.txt @@ -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 ``, and *not* + with ``make gh-pages``. .. [reStructuredText] reStructuredText. http://docutils.sourceforge.net/rst.html .. [Sphinx] Sphinx. http://sphinx.pocoo.org/