-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
shimizukawa
committed
Apr 9, 2011
1 parent
c7f6181
commit e3e4299
Showing
44 changed files
with
4,841 additions
and
4,846 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
build | ||
__pycache__/ |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,80 @@ | ||
#!/usr/bin/env python | ||
"""Script to build documentation using Sphinx. | ||
""" | ||
|
||
import fileinput, os, sys | ||
|
||
def oscmd(c): | ||
os.system(c) | ||
|
||
if os.path.isdir("build"): | ||
os.removedirs("build") | ||
|
||
os.makedirs("build/html") | ||
os.makedirs("build/latex") | ||
|
||
# html manual. | ||
oscmd('sphinx-build -d build/doctrees source build/html') | ||
|
||
if sys.platform != 'win32': | ||
# LaTeX format. | ||
oscmd('sphinx-build -b latex -d build/doctrees source build/latex') | ||
|
||
# Produce pdf. | ||
topdir = os.getcwd() | ||
os.chdir('build/latex') | ||
|
||
# Change chapter style to section style: allows chapters to start on | ||
# the current page. Works much better for the short chapters we have. | ||
# This must go in the class file rather than the preamble, so we modify | ||
# manual.cls at runtime. | ||
chapter_cmds=r''' | ||
% Local changes. | ||
\renewcommand\chapter{ | ||
\thispagestyle{plain} | ||
\global\@topnum\z@ | ||
\@afterindentfalse | ||
\secdef\@chapter\@schapter | ||
} | ||
\def\@makechapterhead#1{ | ||
\vspace*{10\p@} | ||
{\raggedright \reset@font \Huge \bfseries \thechapter \quad #1} | ||
\par\nobreak | ||
\hrulefill | ||
\par\nobreak | ||
\vspace*{10\p@} | ||
} | ||
\def\@makeschapterhead#1{ | ||
\vspace*{10\p@} | ||
{\raggedright \reset@font \Huge \bfseries #1} | ||
\par\nobreak | ||
\hrulefill | ||
\par\nobreak | ||
\vspace*{10\p@} | ||
} | ||
''' | ||
|
||
unmodified=True | ||
for line in fileinput.FileInput('manual.cls',inplace=1): | ||
if 'Support for module synopsis' in line and unmodified: | ||
line=chapter_cmds+line | ||
elif 'makechapterhead' in line: | ||
# Already have altered manual.cls: don't need to again. | ||
unmodified=False | ||
print(line, end=' ') | ||
|
||
# Copying the makefile produced by sphinx... | ||
oscmd('pdflatex pyreadline.tex') | ||
oscmd('pdflatex pyreadline.tex') | ||
oscmd('pdflatex pyreadline.tex') | ||
oscmd('makeindex -s python.ist pyreadline.idx') | ||
oscmd('makeindex -s python.ist modpyreadline.idx') | ||
oscmd('pdflatex pyreadline.tex') | ||
oscmd('pdflatex pyreadline.tex') | ||
|
||
# Create a manual/ directory with final html/pdf output | ||
# os.chdir(topdir) | ||
# oscmd('rm -rf manual') | ||
# oscmd('mkdir manual') | ||
# oscmd('cp -r build/html/*.html build/html/_static manual/') | ||
# oscmd('cp build/latex/ipython.pdf manual/') | ||
#!/usr/bin/env python | ||
"""Script to build documentation using Sphinx. | ||
""" | ||
|
||
import fileinput, os, sys | ||
|
||
def oscmd(c): | ||
os.system(c) | ||
|
||
if os.path.isdir("build"): | ||
os.removedirs("build") | ||
|
||
os.makedirs("build/html") | ||
os.makedirs("build/latex") | ||
|
||
# html manual. | ||
oscmd('sphinx-build -d build/doctrees source build/html') | ||
|
||
if sys.platform != 'win32': | ||
# LaTeX format. | ||
oscmd('sphinx-build -b latex -d build/doctrees source build/latex') | ||
|
||
# Produce pdf. | ||
topdir = os.getcwd() | ||
os.chdir('build/latex') | ||
|
||
# Change chapter style to section style: allows chapters to start on | ||
# the current page. Works much better for the short chapters we have. | ||
# This must go in the class file rather than the preamble, so we modify | ||
# manual.cls at runtime. | ||
chapter_cmds=r''' | ||
% Local changes. | ||
\renewcommand\chapter{ | ||
\thispagestyle{plain} | ||
\global\@topnum\z@ | ||
\@afterindentfalse | ||
\secdef\@chapter\@schapter | ||
} | ||
\def\@makechapterhead#1{ | ||
\vspace*{10\p@} | ||
{\raggedright \reset@font \Huge \bfseries \thechapter \quad #1} | ||
\par\nobreak | ||
\hrulefill | ||
\par\nobreak | ||
\vspace*{10\p@} | ||
} | ||
\def\@makeschapterhead#1{ | ||
\vspace*{10\p@} | ||
{\raggedright \reset@font \Huge \bfseries #1} | ||
\par\nobreak | ||
\hrulefill | ||
\par\nobreak | ||
\vspace*{10\p@} | ||
} | ||
''' | ||
|
||
unmodified=True | ||
for line in fileinput.FileInput('manual.cls',inplace=1): | ||
if 'Support for module synopsis' in line and unmodified: | ||
line=chapter_cmds+line | ||
elif 'makechapterhead' in line: | ||
# Already have altered manual.cls: don't need to again. | ||
unmodified=False | ||
print line, | ||
|
||
# Copying the makefile produced by sphinx... | ||
oscmd('pdflatex pyreadline.tex') | ||
oscmd('pdflatex pyreadline.tex') | ||
oscmd('pdflatex pyreadline.tex') | ||
oscmd('makeindex -s python.ist pyreadline.idx') | ||
oscmd('makeindex -s python.ist modpyreadline.idx') | ||
oscmd('pdflatex pyreadline.tex') | ||
oscmd('pdflatex pyreadline.tex') | ||
|
||
# Create a manual/ directory with final html/pdf output | ||
# os.chdir(topdir) | ||
# oscmd('rm -rf manual') | ||
# oscmd('mkdir manual') | ||
# oscmd('cp -r build/html/*.html build/html/_static manual/') | ||
# oscmd('cp build/latex/ipython.pdf manual/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.