##// END OF EJS Templates
docs: new changes by james spencer to improve pdf doc style....
Ville M. Vainio -
Show More
@@ -1,30 +1,64 b''
1 import fileinput,os,sys
1 import fileinput,os,sys
2
2
3 def oscmd(c):
3 def oscmd(c):
4 os.system(c)
4 os.system(c)
5
5
6 # html manual.
6 # html manual.
7 oscmd('sphinx-build -d build/doctrees source build/html')
7 oscmd('sphinx-build -d build/doctrees source build/html')
8
8
9 if sys.platform != 'win32':
9 if sys.platform != 'win32':
10 # LaTeX format.
10 # LaTeX format.
11 oscmd('sphinx-build -b latex -d build/doctrees source build/latex')
11 oscmd('sphinx-build -b latex -d build/doctrees source build/latex')
12
12
13 # Produce pdf.
13 # Produce pdf.
14 os.chdir('build/latex')
14 os.chdir('build/latex')
15
15
16 # Change chapter style to section style: allows chapters to start on the current page. Works much better for the short chapters we have.
16 # Change chapter style to section style: allows chapters to start on
17 # the current page. Works much better for the short chapters we have.
18 # This must go in the class file rather than the preamble, so we modify
19 # manual.cls at runtime.
20 chapter_cmds=r'''
21 % Local changes.
22 \renewcommand\chapter{
23 \thispagestyle{plain}
24 \global\@topnum\z@
25 \@afterindentfalse
26 \secdef\@chapter\@schapter
27 }
28 \def\@makechapterhead#1{
29 \vspace*{10\p@}
30 {\raggedright \reset@font \Huge \bfseries \thechapter \quad #1}
31 \par\nobreak
32 \hrulefill
33 \par\nobreak
34 \vspace*{10\p@}
35 }
36 \def\@makeschapterhead#1{
37 \vspace*{10\p@}
38 {\raggedright \reset@font \Huge \bfseries #1}
39 \par\nobreak
40 \hrulefill
41 \par\nobreak
42 \vspace*{10\p@}
43 }
44 '''
45
46 unmodified=True
17 for line in fileinput.FileInput('manual.cls',inplace=1):
47 for line in fileinput.FileInput('manual.cls',inplace=1):
18 line=line.replace('py@OldChapter=\chapter','py@OldChapter=\section')
48 if 'Support for module synopsis' in line and unmodified:
49 line=chapter_cmds+line
50 elif 'makechapterhead' in line:
51 # Already have altered manual.cls: don't need to again.
52 unmodified=False
19 print line,
53 print line,
20
54
21 # Copying the makefile produced by sphinx...
55 # Copying the makefile produced by sphinx...
22 oscmd('pdflatex ipython.tex')
56 oscmd('pdflatex ipython.tex')
23 oscmd('pdflatex ipython.tex')
57 oscmd('pdflatex ipython.tex')
24 oscmd('pdflatex ipython.tex')
58 oscmd('pdflatex ipython.tex')
25 oscmd('makeindex -s python.ist ipython.idx')
59 oscmd('makeindex -s python.ist ipython.idx')
26 oscmd('makeindex -s python.ist modipython.idx')
60 oscmd('makeindex -s python.ist modipython.idx')
27 oscmd('pdflatex ipython.tex')
61 oscmd('pdflatex ipython.tex')
28 oscmd('pdflatex ipython.tex')
62 oscmd('pdflatex ipython.tex')
29
63
30 os.chdir('../..')
64 os.chdir('../..')
@@ -1,132 +1,132 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 #
2 #
3 # IPython documentation build configuration file, created by
3 # IPython documentation build configuration file, created by
4 # sphinx-quickstart.py on Sat Mar 29 15:36:13 2008.
4 # sphinx-quickstart.py on Sat Mar 29 15:36:13 2008.
5 #
5 #
6 # This file is execfile()d with the current directory set to its containing dir.
6 # This file is execfile()d with the current directory set to its containing dir.
7 #
7 #
8 # The contents of this file are pickled, so don't put values in the namespace
8 # The contents of this file are pickled, so don't put values in the namespace
9 # that aren't pickleable (module imports are okay, they're removed automatically).
9 # that aren't pickleable (module imports are okay, they're removed automatically).
10 #
10 #
11 # All configuration values have a default value; values that are commented out
11 # All configuration values have a default value; values that are commented out
12 # serve to show the default value.
12 # serve to show the default value.
13
13
14 import sys
14 import sys
15
15
16 # If your extensions are in another directory, add it here.
16 # If your extensions are in another directory, add it here.
17 #sys.path.append('some/directory')
17 #sys.path.append('some/directory')
18
18
19 # General configuration
19 # General configuration
20 # ---------------------
20 # ---------------------
21
21
22 # Add any Sphinx extension module names here, as strings. They can be extensions
22 # Add any Sphinx extension module names here, as strings. They can be extensions
23 # coming with Sphinx (named 'sphinx.addons.*') or your custom ones.
23 # coming with Sphinx (named 'sphinx.addons.*') or your custom ones.
24 #extensions = []
24 #extensions = []
25
25
26 # Add any paths that contain templates here, relative to this directory.
26 # Add any paths that contain templates here, relative to this directory.
27 templates_path = ['_templates']
27 templates_path = ['_templates']
28
28
29 # The suffix of source filenames.
29 # The suffix of source filenames.
30 source_suffix = '.rst'
30 source_suffix = '.rst'
31
31
32 # The master toctree document.
32 # The master toctree document.
33 master_doc = 'ipython'
33 master_doc = 'ipython'
34
34
35 # General substitutions.
35 # General substitutions.
36 project = 'IPython'
36 project = 'IPython'
37 copyright = '2008, IPython team'
37 copyright = '2008, IPython team'
38
38
39 # The default replacements for |version| and |release|, also used in various
39 # The default replacements for |version| and |release|, also used in various
40 # other places throughout the built documents.
40 # other places throughout the built documents.
41 #
41 #
42 # The short X.Y version.
42 # The short X.Y version.
43 version = '0.8.3'
43 version = '0.8.3'
44 # The full version, including alpha/beta/rc tags.
44 # The full version, including alpha/beta/rc tags.
45 release = '0.8.3'
45 release = '0.8.3'
46
46
47 # There are two options for replacing |today|: either, you set today to some
47 # There are two options for replacing |today|: either, you set today to some
48 # non-false value, then it is used:
48 # non-false value, then it is used:
49 #today = ''
49 #today = ''
50 # Else, today_fmt is used as the format for a strftime call.
50 # Else, today_fmt is used as the format for a strftime call.
51 today_fmt = '%B %d, %Y'
51 today_fmt = '%B %d, %Y'
52
52
53 # List of documents that shouldn't be included in the build.
53 # List of documents that shouldn't be included in the build.
54 #unused_docs = []
54 #unused_docs = []
55
55
56 # If true, '()' will be appended to :func: etc. cross-reference text.
56 # If true, '()' will be appended to :func: etc. cross-reference text.
57 #add_function_parentheses = True
57 #add_function_parentheses = True
58
58
59 # If true, the current module name will be prepended to all description
59 # If true, the current module name will be prepended to all description
60 # unit titles (such as .. function::).
60 # unit titles (such as .. function::).
61 #add_module_names = True
61 #add_module_names = True
62
62
63 # If true, sectionauthor and moduleauthor directives will be shown in the
63 # If true, sectionauthor and moduleauthor directives will be shown in the
64 # output. They are ignored by default.
64 # output. They are ignored by default.
65 #show_authors = False
65 #show_authors = False
66
66
67 # The name of the Pygments (syntax highlighting) style to use.
67 # The name of the Pygments (syntax highlighting) style to use.
68 pygments_style = 'sphinx'
68 pygments_style = 'sphinx'
69
69
70
70
71 # Options for HTML output
71 # Options for HTML output
72 # -----------------------
72 # -----------------------
73
73
74 # The style sheet to use for HTML and HTML Help pages. A file of that name
74 # The style sheet to use for HTML and HTML Help pages. A file of that name
75 # must exist either in Sphinx' static/ path, or in one of the custom paths
75 # must exist either in Sphinx' static/ path, or in one of the custom paths
76 # given in html_static_path.
76 # given in html_static_path.
77 html_style = 'default.css'
77 html_style = 'default.css'
78
78
79 # Add any paths that contain custom static files (such as style sheets) here,
79 # Add any paths that contain custom static files (such as style sheets) here,
80 # relative to this directory. They are copied after the builtin static files,
80 # relative to this directory. They are copied after the builtin static files,
81 # so a file named "default.css" will overwrite the builtin "default.css".
81 # so a file named "default.css" will overwrite the builtin "default.css".
82 html_static_path = ['_static']
82 html_static_path = ['_static']
83
83
84 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
84 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
85 # using the given strftime format.
85 # using the given strftime format.
86 html_last_updated_fmt = '%b %d, %Y'
86 html_last_updated_fmt = '%b %d, %Y'
87
87
88 # If true, SmartyPants will be used to convert quotes and dashes to
88 # If true, SmartyPants will be used to convert quotes and dashes to
89 # typographically correct entities.
89 # typographically correct entities.
90 #html_use_smartypants = True
90 #html_use_smartypants = True
91
91
92 # Content template for the index page.
92 # Content template for the index page.
93 #html_index = ''
93 #html_index = ''
94
94
95 # Custom sidebar templates, maps document names to template names.
95 # Custom sidebar templates, maps document names to template names.
96 #html_sidebars = {}
96 #html_sidebars = {}
97
97
98 # Additional templates that should be rendered to pages, maps page names to
98 # Additional templates that should be rendered to pages, maps page names to
99 # template names.
99 # template names.
100 #html_additional_pages = {}
100 #html_additional_pages = {}
101
101
102 # If false, no module index is generated.
102 # If false, no module index is generated.
103 #html_use_modindex = True
103 #html_use_modindex = True
104
104
105 # If true, the reST sources are included in the HTML build as _sources/<name>.
105 # If true, the reST sources are included in the HTML build as _sources/<name>.
106 #html_copy_source = True
106 #html_copy_source = True
107
107
108 # Output file base name for HTML help builder.
108 # Output file base name for HTML help builder.
109 htmlhelp_basename = 'IPythondoc'
109 htmlhelp_basename = 'IPythondoc'
110
110
111
111
112 # Options for LaTeX output
112 # Options for LaTeX output
113 # ------------------------
113 # ------------------------
114
114
115 # The paper size ('letter' or 'a4').
115 # The paper size ('letter' or 'a4').
116 latex_paper_size = 'a4'
116 latex_paper_size = 'a4'
117
117
118 # The font size ('10pt', '11pt' or '12pt').
118 # The font size ('10pt', '11pt' or '12pt').
119 latex_font_size = '10pt'
119 latex_font_size = '10pt'
120
120
121 # Grouping the document tree into LaTeX files. List of tuples
121 # Grouping the document tree into LaTeX files. List of tuples
122 # (source start file, target name, title, author, document class [howto/manual]).
122 # (source start file, target name, title, author, document class [howto/manual]).
123 latex_documents = [('ipython','ipython.tex','IPython Documentation','IPython developers','manual')]
123 latex_documents = [('ipython','ipython.tex','IPython Documentation','IPython developers','manual')]
124
124
125 # Additional stuff for the LaTeX preamble.
125 # Additional stuff for the LaTeX preamble.
126 latex_preamble = '\\def\\thesection{\\arabic{section}}'
126 #latex_preamble = ''
127
127
128 # Documents to append as an appendix to all manuals.
128 # Documents to append as an appendix to all manuals.
129 #latex_appendices = []
129 #latex_appendices = []
130
130
131 # If false, no module index is generated.
131 # If false, no module index is generated.
132 #latex_use_modindex = True
132 #latex_use_modindex = True
General Comments 0
You need to be logged in to leave comments. Login now