Show More
@@ -103,8 +103,8 b' gitwash-update:' | |||||
103 | nightly: dist |
|
103 | nightly: dist | |
104 | rsync -avH --delete dist/ ipython:www/doc/nightly |
|
104 | rsync -avH --delete dist/ ipython:www/doc/nightly | |
105 |
|
105 | |||
106 | gh-pages: html |
|
106 | gh-pages: html pdf | |
107 | python gh-pages.py |
|
107 | python gh-pages.py | |
108 |
|
108 | |||
109 | gh-pages-current: html |
|
109 | gh-pages-current: html pdf | |
110 | python gh-pages.py current |
|
110 | python gh-pages.py current "Current Development Version" |
@@ -29,6 +29,7 b' from subprocess import Popen, PIPE, CalledProcessError, check_call' | |||||
29 |
|
29 | |||
30 | pages_dir = 'gh-pages' |
|
30 | pages_dir = 'gh-pages' | |
31 | html_dir = 'build/html' |
|
31 | html_dir = 'build/html' | |
|
32 | pdf_dir = 'build/latex' | |||
32 | pages_repo = 'git@github.com:ipython/ipython-doc.git' |
|
33 | pages_repo = 'git@github.com:ipython/ipython-doc.git' | |
33 |
|
34 | |||
34 | #----------------------------------------------------------------------------- |
|
35 | #----------------------------------------------------------------------------- | |
@@ -74,20 +75,28 b' def init_repo(path):' | |||||
74 | cd(here) |
|
75 | cd(here) | |
75 |
|
76 | |||
76 |
|
77 | |||
77 | def render_htmlindex(fname, tag): |
|
78 | def render_htmlindex(fname, tag, desc=None): | |
78 | rel = '<li> Release: <a href="{t}/index.html">{t}</a>'.format(t=tag) |
|
79 | if desc is None: | |
|
80 | desc = tag | |||
|
81 | ||||
|
82 | rel = '<li>{d}: <a href="{t}/index.html">HTML</a> and <a href="{t}/ipython.pdf">PDF</a>'.format(t=tag,d=desc) | |||
79 | rep = re.compile('<!-- RELEASE -->') |
|
83 | rep = re.compile('<!-- RELEASE -->') | |
80 | out = [] |
|
84 | out = [] | |
81 | with file(fname) as f: |
|
85 | with file(fname) as f: | |
82 | for line in f: |
|
86 | contents = f.read() | |
|
87 | lines = contents.splitlines() | |||
|
88 | if rel in contents: | |||
|
89 | out = lines | |||
|
90 | else: | |||
|
91 | for line in lines: | |||
83 | out.append(line) |
|
92 | out.append(line) | |
84 | if rep.search(line): |
|
93 | if rep.search(line): | |
85 | out.append(rep.sub(rel, line)) |
|
94 | out.append(rep.sub(rel, line)) | |
86 | return ''.join(out) |
|
95 | return '\n'.join(out)+'\n' | |
87 |
|
96 | |||
88 |
|
97 | |||
89 | def new_htmlindex(fname, tag): |
|
98 | def new_htmlindex(fname, tag, desc=None): | |
90 | new_page = render_htmlindex(fname, tag) |
|
99 | new_page = render_htmlindex(fname, tag, desc) | |
91 | os.rename(fname, fname+'~') |
|
100 | os.rename(fname, fname+'~') | |
92 | with file(fname, 'w') as f: |
|
101 | with file(fname, 'w') as f: | |
93 | f.write(new_page) |
|
102 | f.write(new_page) | |
@@ -102,7 +111,12 b" if __name__ == '__main__':" | |||||
102 | tag = sys.argv[1] |
|
111 | tag = sys.argv[1] | |
103 | except IndexError: |
|
112 | except IndexError: | |
104 | tag = sh2('git describe') |
|
113 | tag = sh2('git describe') | |
105 |
|
114 | |||
|
115 | try: | |||
|
116 | desc = sys.argv[2] | |||
|
117 | except IndexError: | |||
|
118 | desc="Release (%s)"%tag | |||
|
119 | ||||
106 | startdir = os.getcwd() |
|
120 | startdir = os.getcwd() | |
107 | if not os.path.exists(pages_dir): |
|
121 | if not os.path.exists(pages_dir): | |
108 | init_repo(pages_dir) |
|
122 | init_repo(pages_dir) | |
@@ -116,6 +130,7 b" if __name__ == '__main__':" | |||||
116 | # directory, and then copy the html tree in there |
|
130 | # directory, and then copy the html tree in there | |
117 | shutil.rmtree(dest, ignore_errors=True) |
|
131 | shutil.rmtree(dest, ignore_errors=True) | |
118 | shutil.copytree(html_dir, dest) |
|
132 | shutil.copytree(html_dir, dest) | |
|
133 | shutil.copy(pjoin(pdf_dir, 'ipython.pdf'), pjoin(dest, 'ipython.pdf')) | |||
119 |
|
134 | |||
120 | try: |
|
135 | try: | |
121 | cd(pages_dir) |
|
136 | cd(pages_dir) | |
@@ -128,7 +143,7 b" if __name__ == '__main__':" | |||||
128 | raise RuntimeError(e) |
|
143 | raise RuntimeError(e) | |
129 |
|
144 | |||
130 | sh('git add %s' % tag) |
|
145 | sh('git add %s' % tag) | |
131 | new_htmlindex('index.html', tag) |
|
146 | new_htmlindex('index.html', tag, desc) | |
132 | sh('git add index.html') |
|
147 | sh('git add index.html') | |
133 | sh('git commit -m"Created new doc release, named: %s"' % tag) |
|
148 | sh('git commit -m"Created new doc release, named: %s"' % tag) | |
134 |
|
149 |
1 | NO CONTENT: file renamed from docs/source/interactive/figs/colors.dark.png to docs/source/interactive/figs/colors_dark.png |
|
NO CONTENT: file renamed from docs/source/interactive/figs/colors.dark.png to docs/source/interactive/figs/colors_dark.png |
@@ -120,7 +120,7 b' styles associated with each ``--colors`` option.' | |||||
120 | Screenshot of ``ipython-qtconsole --colors dark``, which uses the 'monokai' theme by |
|
120 | Screenshot of ``ipython-qtconsole --colors dark``, which uses the 'monokai' theme by | |
121 | default: |
|
121 | default: | |
122 |
|
122 | |||
123 |
.. image:: figs/colors |
|
123 | .. image:: figs/colors_dark.png | |
124 | :width: 627px |
|
124 | :width: 627px | |
125 |
|
125 | |||
126 | .. Note:: |
|
126 | .. Note:: |
General Comments 0
You need to be logged in to leave comments.
Login now