Skip to content

Commit 4ff5bca

Browse files
committed
Use the in-progress manual version without includes
1 parent 476777b commit 4ff5bca

1 file changed

Lines changed: 237 additions & 32 deletions

File tree

‎source/manual.rst‎

Lines changed: 237 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,142 @@ As well as the rst2pdf-specific features described in this manual, you many also
6666
Command line options
6767
--------------------
6868

69-
.. include:: rst2pdf.rst
70-
:start-line: 30
71-
:end-before: EXAMPLES
69+
Use the following options to control the output of `rst2pdf` on the command line.
7270

71+
General Options
72+
~~~~~~~~~~~~~~~
73+
74+
.. list-table::
75+
:header-rows: 1
76+
77+
* - Option
78+
- Description
79+
* - ``-h, --help``
80+
- Show the help message and exit.
81+
* - ``--version``
82+
- Print the version number and exit.
83+
* - ``-q, --quiet``
84+
- Print less information.
85+
* - ``-v, --verbose``
86+
- Print debug information.
87+
* - ``--very-verbose``
88+
- Print even more debug information.
89+
90+
File and Configuration
91+
~~~~~~~~~~~~~~~~~~~~~~~
92+
93+
.. list-table::
94+
:header-rows: 1
95+
96+
* - Option
97+
- Description
98+
* - ``--config=FILE``
99+
- Config file to use. Default: ``~/.rst2pdf/config``.
100+
* - ``-o FILE, --output=FILE``
101+
- Write the PDF to ``FILE``.
102+
* - ``--record-dependencies=FILE``
103+
- Write output file dependencies to ``FILE``.
104+
105+
Styling Options
106+
~~~~~~~~~~~~~~~
107+
108+
.. list-table::
109+
:header-rows: 1
110+
111+
* - Option
112+
- Description
113+
* - ``-s STYLESHEETS, --stylesheets=STYLESHEETS``
114+
- A comma-separated list of custom stylesheets. Default: ``""``.
115+
* - ``--stylesheet-path=FOLDERLIST``
116+
- A colon-separated list of folders to search for stylesheets. Default: ``""``.
117+
* - ``--print-stylesheet``
118+
- Print the default stylesheet and exit.
119+
* - ``--font-path=FOLDERLIST``
120+
- A colon-separated list of folders to search for fonts. Default: ``""``.
121+
122+
123+
PDF Options
124+
~~~~~~~~~~~
125+
126+
.. list-table::
127+
:header-rows: 1
128+
129+
* - Option
130+
- Description
131+
* - ``-c, --compressed``
132+
- Create a compressed PDF. Default: ``False``.
133+
* - ``--baseurl=URL``
134+
- The base URL for relative URLs.
135+
* - ``--header=HEADER``
136+
- Page header if not specified in the document.
137+
* - ``--footer=FOOTER``
138+
- Page footer if not specified in the document.
139+
* - ``--first-page-on-right``
140+
- When using double-sided pages, the first page will start on the right-hand side (Book Style).
141+
* - ``--blank-first-page``
142+
- Add a blank page at the beginning of the document.
143+
* - ``--custom-cover=FILE``
144+
- Template file used for the cover page. Default: ``cover.tmpl``.
145+
146+
Formatting Options
147+
~~~~~~~~~~~~~~~~~~
148+
149+
.. list-table::
150+
:header-rows: 1
151+
152+
* - Option
153+
- Description
154+
* - ``--section-header-depth=N``
155+
- Sections up to this depth will be used in the header and footer's replacement of ``###Section###``. Default: ``2``.
156+
* - ``--smart-quotes=VALUE``
157+
- Convert ASCII quotes, ellipses, and dashes to typographically correct equivalents. Default: ``0``.
158+
159+
Accepted values:
160+
161+
- ``0``: Suppress all transformations.
162+
- ``1``: Default transformations for quotes, em-dashes, and ellipses.
163+
- ``2``: Use typewriter shorthand for dashes.
164+
- ``3``: Invert shorthand for dashes.
165+
166+
* - ``--fit-literal-mode=MODE``
167+
- Handle literals that are too wide. Options: ``error``, ``overflow``, ``shrink``, ``truncate``. Default: ``shrink``.
168+
* - ``--fit-background-mode=MODE``
169+
- Fit the background image to the page. Options: ``scale``, ``scale_width``, ``center``. Default: ``center``.
170+
171+
Miscellaneous Options
172+
~~~~~~~~~~~~~~~~~~~~~
173+
174+
.. list-table::
175+
:header-rows: 1
176+
177+
* - Option
178+
- Description
179+
* - ``-e EXTENSIONS, --extension-module=EXTENSIONS``
180+
- Add a helper extension module (must end in ``.py`` and be on the Python path).
181+
* - ``--inline-links``
182+
- Show targets in parentheses instead of active links.
183+
* - ``--repeat-table-rows``
184+
- Repeat the header row for each split table.
185+
* - ``--raw-html``
186+
- Support embedding raw HTML. Default: ``False``.
187+
* - ``--no-footnote-backlinks``
188+
- Disable footnote backlinks. Default: ``False``.
189+
* - ``--inline-footnotes``
190+
- Show footnotes inline. Default: ``True``.
191+
* - ``--default-dpi=NUMBER``
192+
- DPI for objects sized in pixels. Default: ``300``.
193+
* - ``--show-frame-boundary``
194+
- Show frame borders (useful for debugging). Default: ``False``.
195+
* - ``--disable-splittables``
196+
- Disable splittable flowables in some elements. Useful if a document cannot otherwise be processed.
197+
* - ``--break-side=VALUE``
198+
- Section break behavior. Options: ``even``, ``odd``, ``any``.
73199

74200
Configuration File
75201
-------------------
76202

203+
The configuration file uses an **INI-style** format with sections and key-value pairs. Comments are prefixed with ``#``.
204+
77205
Since version 0.8, rst2pdf will read (if it is available) configuration files in
78206
``/etc/rst2pdf.conf`` and ``~/.rst2pdf/config``.
79207

@@ -84,11 +212,100 @@ The user's file at ``~/.rst2pdf/config`` will have priority over the system's at
84212
systems. if you are using rst2pdf in other systems, please contact me and
85213
tell me where the system-wide config file should be.
86214
87-
Here's an example file showing some of the currently available options:
215+
Configuration Options
216+
~~~~~~~~~~~~~~~~~~~~~
217+
218+
The table below provides detailed descriptions of the available configuration options.
219+
220+
.. list-table::
221+
:header-rows: 1
222+
223+
* - Option
224+
- Description
225+
- Default Value
226+
* - ``stylesheets``
227+
- Comma-separated list of custom stylesheets.
228+
- ``""``
229+
* - ``compressed``
230+
- Generate a compressed PDF. Use ``true``/``false`` or ``1``/``0``.
231+
- ``false``
232+
* - ``font_path``
233+
- Colon-separated list of folders to search for fonts.
234+
- ``""``
235+
* - ``stylesheet_path``
236+
- Colon-separated list of folders to search for stylesheets.
237+
- ``""``
238+
* - ``language``
239+
- Language for hyphenation and localization.
240+
- ``en_US``
241+
* - ``header``
242+
- Default page header. Use ``null`` for no header.
243+
- ``null``
244+
* - ``footer``
245+
- Default page footer. Use ``null`` for no footer.
246+
- ``null``
247+
* - ``fit_mode``
248+
- Handle oversized literal blocks. Options: ``shrink``, ``truncate``, ``overflow``.
249+
- ``shrink``
250+
* - ``fit_background_mode``
251+
- Adjust background images. Options: ``scale``, ``center``.
252+
- ``center``
253+
* - ``break_level``
254+
- Maximum heading level that starts on a new page.
255+
- ``0``
256+
* - ``break_side``
257+
- Section break alignment. Options: ``even``, ``odd``, ``any``.
258+
- ``any``
259+
* - ``blank_first_page``
260+
- Add a blank page at the start of the document.
261+
- ``false``
262+
* - ``first_page_even``
263+
- Treat the first page as even.
264+
- ``false``
265+
* - ``smartquotes``
266+
- Configure smart quotes transformation.
267+
268+
Accepted values:
269+
270+
- ``0``: Suppress all transformations.
271+
- ``1``: Default transformations for quotes, em-dashes, and ellipses.
272+
- ``2``: Use typewriter shorthand for dashes.
273+
- ``3``: Invert shorthand for dashes.
274+
275+
- ``0``
276+
* - ``footnote_backlinks``
277+
- Enable footnote backlinks.
278+
- ``true``
279+
* - ``inline_footnotes``
280+
- Show footnotes inline.
281+
- ``false``
282+
* - ``custom_cover``
283+
- Template file for the cover page.
284+
- ``cover.tmpl``
285+
* - ``floating_images``
286+
- Enable floating images for alignment.
287+
- ``false``
288+
* - ``raw_html``
289+
- Enable support for the ``..raw:: html`` directive.
290+
- ``false``
291+
292+
Example Configuration File
293+
~~~~~~~~~~~~~~~~~~~~~~~~~~
294+
295+
Here's an example configuration file showing the expected format:
88296

89297
.. code-block:: ini
90-
:include: assets/config.sample
91298
299+
# This is an example config file. Modify and place in ~/.rst2pdf/config
300+
301+
[general]
302+
stylesheets="fruity.json,a4paper.json,verasans.json"
303+
304+
# Folders to search for stylesheets.
305+
stylesheet_path="~/styles:/usr/share/styles"
306+
307+
# Language to be used for hyphenation support
308+
language="en_US"
92309
93310
Pipe usage
94311
----------
@@ -1289,20 +1506,6 @@ The options are:
12891506
``:end-at: string``
12901507
will include file up to the first occurrence of string, string **included**
12911508

1292-
Let's display a class from rst2pdf::
1293-
1294-
.. code-block:: python
1295-
:include: assets/flowables.py
1296-
:start-at: class Separation(Flowable):
1297-
:end-before: class Reference(Flowable):
1298-
1299-
This command gives
1300-
1301-
.. code-block:: python
1302-
:include: assets/flowables.py
1303-
:start-at: class Separation(Flowable):
1304-
:end-before: class Reference(Flowable):
1305-
13061509
.. _supported: http://pygments.org/docs/lexers/
13071510

13081511
.. _pygments: http://pygments.org/
@@ -2086,29 +2289,31 @@ Extensions
20862289
rst2pdf can get new features from *extensions*. Extensions are python modules
20872290
that can be enabled with the ``-e`` option.
20882291

2089-
Several are included with rst2pdf.
2292+
Several are included with rst2pdf, and you can also develop extensions yourself.
2293+
Find the included extensions_ by inspecting the codebase, each file includes some
2294+
additional information about the extension.
2295+
2296+
.. _extensions: https://github.com/rst2pdf/rst2pdf/tree/main/rst2pdf/extensions
20902297

2091-
Preprocess (``-e preprocess``)
2092-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2298+
Extensions include with rst2pdf:
20932299

2094-
.. include:: ../rst2pdf/extensions/preprocess_r2p.py
2095-
:start-after: '''
2096-
:end-before: '''
2300+
- ``dotted_toc`` - a (very) experimental extension to add dots to the table of
2301+
contents list between the titles and the page numbers.
20972302

2098-
Dotted_TOC (``-e dotted_toc``)
2099-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2303+
- ``fancy_titles`` - an experimental extension to render headings with an SVG template.
21002304

2101-
.. include:: ../rst2pdf/extensions/dotted_toc.py
2102-
:start-after: '''
2103-
:end-before: '''
2305+
- ``plantuml_r2p`` - basic PlantUML support.
21042306

2307+
- ``preprocess`` - preprocessing tool to make source file changes before
2308+
handing it to docutils, can help keep compatibility between different output
2309+
destinations.
21052310

21062311
Developers
21072312
----------
21082313

2109-
.. include:: DEVELOPERS.rst
2110-
:start-line: 4
2314+
To contribute to rst2pdf, visit the project_ on GitHub to get started.
21112315

2316+
.. _project: https://github.com/rst2pdf/rst2pdf
21122317

21132318
Licenses
21142319
--------

0 commit comments

Comments
 (0)