Show More
@@ -107,4 +107,5 b' gh-pages: html pdf' | |||||
107 | python gh-pages.py |
|
107 | python gh-pages.py | |
108 |
|
108 | |||
109 | gh-pages-current: html pdf |
|
109 | gh-pages-current: html pdf | |
110 | python gh-pages.py current "Current Development Version" |
|
110 | ipver="$(ipython -v 2>&1)" | |
|
111 | python gh-pages.py dev "Current Development Version ($ipver)" |
@@ -75,12 +75,12 b' def init_repo(path):' | |||||
75 | cd(here) |
|
75 | cd(here) | |
76 |
|
76 | |||
77 |
|
77 | |||
78 |
def render_ |
|
78 | def render_rstindex(fname, tag, desc=None): | |
79 | if desc is None: |
|
79 | if desc is None: | |
80 | desc = tag |
|
80 | desc = tag | |
81 |
|
81 | |||
82 |
rel = ' |
|
82 | rel = '* {d}: `HTML <{t}/index.html>`_ and `PDF <{t}/ipython.pdf>`_.'.format(t=tag,d=desc) | |
83 |
rep = re.compile(' |
|
83 | rep = re.compile(r'\.\. release') | |
84 | out = [] |
|
84 | out = [] | |
85 | with file(fname) as f: |
|
85 | with file(fname) as f: | |
86 | contents = f.read() |
|
86 | contents = f.read() | |
@@ -95,8 +95,8 b' def render_htmlindex(fname, tag, desc=None):' | |||||
95 | return '\n'.join(out)+'\n' |
|
95 | return '\n'.join(out)+'\n' | |
96 |
|
96 | |||
97 |
|
97 | |||
98 |
def new_ |
|
98 | def new_rstindex(fname, tag, desc=None): | |
99 |
new_page = render_ |
|
99 | new_page = render_rstindex(fname, tag, desc) | |
100 | os.rename(fname, fname+'~') |
|
100 | os.rename(fname, fname+'~') | |
101 | with file(fname, 'w') as f: |
|
101 | with file(fname, 'w') as f: | |
102 | f.write(new_page) |
|
102 | f.write(new_page) | |
@@ -119,7 +119,14 b" if __name__ == '__main__':" | |||||
119 |
|
119 | |||
120 | startdir = os.getcwd() |
|
120 | startdir = os.getcwd() | |
121 | if not os.path.exists(pages_dir): |
|
121 | if not os.path.exists(pages_dir): | |
|
122 | # init the repo | |||
122 | init_repo(pages_dir) |
|
123 | init_repo(pages_dir) | |
|
124 | else: | |||
|
125 | # ensure up-to-date before operating | |||
|
126 | cd(pages_dir) | |||
|
127 | sh('git checkout gh-pages') | |||
|
128 | sh('git pull') | |||
|
129 | cd(startdir) | |||
123 |
|
130 | |||
124 | dest = pjoin(pages_dir, tag) |
|
131 | dest = pjoin(pages_dir, tag) | |
125 |
|
132 | |||
@@ -134,7 +141,6 b" if __name__ == '__main__':" | |||||
134 |
|
141 | |||
135 | try: |
|
142 | try: | |
136 | cd(pages_dir) |
|
143 | cd(pages_dir) | |
137 | sh('git checkout gh-pages') |
|
|||
138 | status = sh2('git status | head -1') |
|
144 | status = sh2('git status | head -1') | |
139 | branch = re.match('\# On branch (.*)$', status).group(1) |
|
145 | branch = re.match('\# On branch (.*)$', status).group(1) | |
140 | if branch != 'gh-pages': |
|
146 | if branch != 'gh-pages': | |
@@ -143,8 +149,9 b" if __name__ == '__main__':" | |||||
143 | raise RuntimeError(e) |
|
149 | raise RuntimeError(e) | |
144 |
|
150 | |||
145 | sh('git add %s' % tag) |
|
151 | sh('git add %s' % tag) | |
146 |
new_ |
|
152 | new_rstindex('index.rst', tag, desc) | |
147 |
sh(' |
|
153 | sh('python build_index.py') | |
|
154 | sh('git add index.rst index.html') | |||
148 | sh('git commit -m"Created new doc release, named: %s"' % tag) |
|
155 | sh('git commit -m"Created new doc release, named: %s"' % tag) | |
149 |
|
156 | |||
150 | print 'Most recent 3 commits:' |
|
157 | print 'Most recent 3 commits:' |
General Comments 0
You need to be logged in to leave comments.
Login now