Skip to content

Commit 4689259

Browse files
committed
finished doc reorg, we can use numpy's documentation infrastructure now
1 parent 8ae515a commit 4689259

25 files changed

+1375
-7
lines changed

.bzrignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
build
33
.eric4project/project-apis.db
44
.ropeproject/objectdb
5+
doc/source/reference/generated

doc/postprocess.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env python
2+
"""
3+
%prog MODE FILES...
4+
5+
Post-processes HTML and Latex files output by Sphinx.
6+
MODE is either 'html' or 'tex'.
7+
8+
"""
9+
import re, optparse
10+
11+
def main():
12+
p = optparse.OptionParser(__doc__)
13+
options, args = p.parse_args()
14+
15+
if len(args) < 1:
16+
p.error('no mode given')
17+
18+
mode = args.pop(0)
19+
20+
if mode not in ('html', 'tex'):
21+
p.error('unknown mode %s' % mode)
22+
23+
for fn in args:
24+
f = open(fn, 'r')
25+
try:
26+
if mode == 'html':
27+
lines = process_html(fn, f.readlines())
28+
elif mode == 'tex':
29+
lines = process_tex(f.readlines())
30+
finally:
31+
f.close()
32+
33+
f = open(fn, 'w')
34+
f.write("".join(lines))
35+
f.close()
36+
37+
def process_html(fn, lines):
38+
return lines
39+
40+
def process_tex(lines):
41+
"""
42+
Remove unnecessary section titles from the LaTeX file.
43+
44+
"""
45+
new_lines = []
46+
for line in lines:
47+
if (line.startswith(r'\section{numpy.')
48+
or line.startswith(r'\subsection{numpy.')
49+
or line.startswith(r'\subsubsection{numpy.')
50+
or line.startswith(r'\paragraph{numpy.')
51+
or line.startswith(r'\subparagraph{numpy.')
52+
):
53+
pass # skip!
54+
else:
55+
new_lines.append(line)
56+
return new_lines
57+
58+
if __name__ == "__main__":
59+
main()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ <h1>Welcome</h1>
1919
<h2>Documentation</h2>
2020
<table class="contentstable" align="center" style="margin-left: 30px"><tr>
2121
<td width="50%">
22-
<p class="biglink"><a class="biglink" href="{{ pathto("users/tutorial") }}">Tutorial</a><br/>
22+
<p class="biglink"><a class="biglink" href="{{ pathto("user/tutorial") }}">Tutorial</a><br/>
2323
<span class="linkdescr">for a crash-course introduction</span></p>
2424
<p class="biglink"><a class="biglink" href="{{ pathto("contents") }}">Contents</a><br/>
2525
<span class="linkdescr">for the full documentation</span></p>

doc/conf.py renamed to doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# If your extensions are in another directory, add it here. If the directory
1717
# is relative to the documentation root, use os.path.abspath to make it
1818
# absolute, like shown here.
19-
sys.path.append(os.path.abspath('sphinxext'))
19+
sys.path.append(os.path.abspath('../sphinxext'))
2020

2121
# General configuration
2222
# ---------------------
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Quantities -- Support for physical quantities based on the popular numpy library
1414
.. toctree::
1515
:maxdepth: 2
1616

17-
users/index.rst
17+
user/index.rst
1818
devel/index.rst
19-
api/index.rst
20-
glossary/index.rst
19+
reference/index.rst
20+
glossary.rst
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)