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