Show More
@@ -105,7 +105,3 b' nightly: dist' | |||||
105 |
|
105 | |||
106 | gh-pages: html pdf |
|
106 | gh-pages: html pdf | |
107 | python gh-pages.py |
|
107 | python gh-pages.py | |
108 |
|
||||
109 | gh-pages-current: html pdf |
|
|||
110 | ipver="$(ipython -v 2>&1)" |
|
|||
111 | python gh-pages.py dev "Current Development Version ($ipver)" |
|
@@ -74,34 +74,6 b' def init_repo(path):' | |||||
74 | sh('git checkout gh-pages') |
|
74 | sh('git checkout gh-pages') | |
75 | cd(here) |
|
75 | cd(here) | |
76 |
|
76 | |||
77 |
|
||||
78 | def render_rstindex(fname, tag, desc=None): |
|
|||
79 | if desc is None: |
|
|||
80 | desc = tag |
|
|||
81 |
|
||||
82 | rel = '* {d}: `HTML <{t}/index.html>`_ and `PDF <{t}/ipython.pdf>`_.'.format(t=tag,d=desc) |
|
|||
83 | rep = re.compile(r'\.\. release') |
|
|||
84 | out = [] |
|
|||
85 | with file(fname) as f: |
|
|||
86 | contents = f.read() |
|
|||
87 | lines = contents.splitlines() |
|
|||
88 | if rel in contents: |
|
|||
89 | out = lines |
|
|||
90 | else: |
|
|||
91 | for line in lines: |
|
|||
92 | out.append(line) |
|
|||
93 | if rep.search(line): |
|
|||
94 | out.append(rep.sub(rel, line)) |
|
|||
95 | return '\n'.join(out)+'\n' |
|
|||
96 |
|
||||
97 |
|
||||
98 | def new_rstindex(fname, tag, desc=None): |
|
|||
99 | new_page = render_rstindex(fname, tag, desc) |
|
|||
100 | os.rename(fname, fname+'~') |
|
|||
101 | with file(fname, 'w') as f: |
|
|||
102 | f.write(new_page) |
|
|||
103 |
|
||||
104 |
|
||||
105 | #----------------------------------------------------------------------------- |
|
77 | #----------------------------------------------------------------------------- | |
106 | # Script starts |
|
78 | # Script starts | |
107 | #----------------------------------------------------------------------------- |
|
79 | #----------------------------------------------------------------------------- | |
@@ -115,11 +87,6 b" if __name__ == '__main__':" | |||||
115 | except CalledProcessError: |
|
87 | except CalledProcessError: | |
116 | tag = "dev" # Fallback |
|
88 | tag = "dev" # Fallback | |
117 |
|
89 | |||
118 | try: |
|
|||
119 | desc = sys.argv[2] |
|
|||
120 | except IndexError: |
|
|||
121 | desc="Release (%s)"%tag |
|
|||
122 |
|
||||
123 | startdir = os.getcwd() |
|
90 | startdir = os.getcwd() | |
124 | if not os.path.exists(pages_dir): |
|
91 | if not os.path.exists(pages_dir): | |
125 | # init the repo |
|
92 | # init the repo | |
@@ -152,10 +119,7 b" if __name__ == '__main__':" | |||||
152 | raise RuntimeError(e) |
|
119 | raise RuntimeError(e) | |
153 |
|
120 | |||
154 | sh('git add %s' % tag) |
|
121 | sh('git add %s' % tag) | |
155 | new_rstindex('index.rst', tag, desc) |
|
122 | sh('git commit -m"Updated doc release: %s"' % tag) | |
156 | sh('python build_index.py') |
|
|||
157 | sh('git add index.rst index.html') |
|
|||
158 | sh('git commit -m"Created new doc release, named: %s"' % tag) |
|
|||
159 |
|
123 | |||
160 | print 'Most recent 3 commits:' |
|
124 | print 'Most recent 3 commits:' | |
161 | sys.stdout.flush() |
|
125 | sys.stdout.flush() |
@@ -149,12 +149,14 b" they're automatically exposed as a website. It works like this:" | |||||
149 | version of the docs repository, copy the built docs into it, and commit your |
|
149 | version of the docs repository, copy the built docs into it, and commit your | |
150 | changes. |
|
150 | changes. | |
151 | * Open the built docs in a web browser, and check that they're as expected. |
|
151 | * Open the built docs in a web browser, and check that they're as expected. | |
152 | * (If rebuilding the docs for the development version, it may have duplicated |
|
152 | * (When building the docs for a new tagged release, you will have to add its link to | |
153 | the link to the development version in the homepage. Remove this from |
|
153 | index.rst, then run ``python build_index.py`` to update index.html. Commit the | |
154 | index.rst, then run ``python build_index.py`` to update index.html. Commit the |
|
|||
155 | change.) |
|
154 | change.) | |
156 | * Upload the docs with ``git push``. This only works if you have write access to |
|
155 | * Upload the docs with ``git push``. This only works if you have write access to | |
157 | the docs repository. |
|
156 | the docs repository. | |
|
157 | * If you are building a version that is not the current dev branch, nor a tagged release, | |||
|
158 | then you must run gh-pages.py directly with ``python gh-pages.py <version>``, and *not* | |||
|
159 | with ``make gh-pages``. | |||
158 |
|
160 | |||
159 | .. [reStructuredText] reStructuredText. http://docutils.sourceforge.net/rst.html |
|
161 | .. [reStructuredText] reStructuredText. http://docutils.sourceforge.net/rst.html | |
160 | .. [Sphinx] Sphinx. http://sphinx.pocoo.org/ |
|
162 | .. [Sphinx] Sphinx. http://sphinx.pocoo.org/ |
General Comments 0
You need to be logged in to leave comments.
Login now