Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address some doc nits #878

Merged
merged 3 commits into from Jun 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 33 additions & 7 deletions README.rst
Expand Up @@ -10,10 +10,9 @@
.. image:: https://img.shields.io/pypi/l/rst2pdf.svg
:target: https://pypi.org/project/rst2pdf/


========================================
=======================================
rst2pdf: Use a text editor. Make a PDF.
========================================
=======================================

The usual way of creating PDF from reStructuredText is by going through LaTeX.
This tool provides an alternative by producing PDF directly using the ReportLab
Expand Down Expand Up @@ -48,8 +47,11 @@ Features

* Supports hyphenation and kerning (using wordaxe).

* `Sphinx`__ integration

* `Full user's manual`__

__ https://www.sphinx-doc.org/
__ https://rst2pdf.org/static/manual.pdf


Expand All @@ -61,8 +63,7 @@ Installation
Install from PyPI
~~~~~~~~~~~~~~~~~

The latest released version may be installed from PyPI by using
``pip``.
The latest released version may be installed from PyPI by using ``pip``::

$ pip install --user rst2pdf

Expand Down Expand Up @@ -93,14 +94,39 @@ of this readme.
Usage
-----

To convert a restructuredText document to a PDF, simply run::
To convert a reStructuredText document to a PDF, simply run::

$ rst2pdf <document name> output.pdf

For information on available options, use ``-h``::

$ rst2pdf -h

To enable basic integration with Sphinx, modify your ``conf.py`` file to enable
the ``rst2pdf.pdfbuilder`` extension and configure the ``pdf_documents``
option. For example::

extensions = [
# ...
'rst2pdf.pdfbuilder',
]

# Grouping the document tree into PDF files. List of tuples
# (source start file, target name, title, author, options).
pdf_documents = [
('index', 'MyProject', 'My Project', 'Author Name'),
]

For information on the ``pdf_documents`` option and the many other options
available, refer to the `manual`__.

__ https://rst2pdf.org/static/manual.pdf


Contributing
------------

rst2pdf wishes to be a welcoming community. With that in mind, please refer to our `CODE_OF_CONDUCT`__.
rst2pdf wishes to be a welcoming community. With that in mind, please refer to our `Community Code of Conduct`__.

__ CODE_OF_CONDUCT.rst

50 changes: 25 additions & 25 deletions doc/manual.rst
Expand Up @@ -1712,7 +1712,7 @@ Sphinx_ is a very popular tool. This is the description from its website:
has excellent support for the documentation of Python projects, but other
documents can be written with it too.

rst2pdf includes an experimental PDF extension for sphinx.
rst2pdf includes an experimental PDF extension for Sphinx.

To use it in your existing Sphinx project you need to do the following:

Expand All @@ -1732,85 +1732,85 @@ To use it in your existing Sphinx project you need to do the following:
# For example: r'Guido van Rossum\\Fred L. Drake, Jr., editor'
#
# The options element is a dictionary that lets you override
# this config per-document.
# For example,
# ('index', u'MyProject', u'My Project', u'Author Name',
# dict(pdf_compressed = True))
# this config per-document. For example:
#
# ('index', 'MyProject', 'My Project', 'Author Name', {'pdf_compressed': True})
#
# would mean that specific document would be compressed
# regardless of the global pdf_compressed setting.
# regardless of the global 'pdf_compressed' setting.

pdf_documents = [
('index', u'MyProject', u'My Project', u'Author Name'),
('index', 'MyProject', 'My Project', 'Author Name'),
]

# A comma-separated list of custom stylesheets. Example:
pdf_stylesheets = ['sphinx','kerning','a4']
pdf_stylesheets = ['sphinx', 'kerning', 'a4']

# A list of folders to search for stylesheets. Example:
pdf_style_path = ['.', '_styles']

# Create a compressed PDF
# Use True/False or 1/0
# Example: compressed=True
#pdf_compressed = False
# pdf_compressed = False

# A colon-separated list of folders to search for fonts. Example:
# pdf_font_path = ['/usr/share/fonts', '/usr/share/texmf-dist/fonts/']

# Language to be used for hyphenation support
#pdf_language = "en_US"
# pdf_language = "en_US"

# Mode for literal blocks wider than the frame. Can be
# overflow, shrink or truncate
#pdf_fit_mode = "shrink"
# pdf_fit_mode = "shrink"

# Section level that forces a break page.
# For example: 1 means top-level sections start in a new page
# 0 means disabled
#pdf_break_level = 0
# pdf_break_level = 0

# When a section starts in a new page, force it to be 'even', 'odd',
# or just use 'any'
#pdf_breakside = 'any'
# pdf_breakside = 'any'

# Insert footnotes where they are defined instead of
# at the end.
#pdf_inline_footnotes = True
# pdf_inline_footnotes = True

# verbosity level. 0 1 or 2
#pdf_verbosity = 0
# pdf_verbosity = 0

# If false, no index is generated.
#pdf_use_index = True
# pdf_use_index = True

# If false, no modindex is generated.
#pdf_use_modindex = True
# pdf_use_modindex = True

# If false, no coverpage is generated.
#pdf_use_coverpage = True
# pdf_use_coverpage = True

# Name of the cover page template to use
#pdf_cover_template = 'sphinxcover.tmpl'
# pdf_cover_template = 'sphinxcover.tmpl'

# Documents to append as an appendix to all manuals.
#pdf_appendices = []
# pdf_appendices = []

# Enable experimental feature to split table cells. Use it
# if you get "DelayedTable too big" errors
#pdf_splittables = False
# pdf_splittables = False

# Set the default DPI for images
#pdf_default_dpi = 72
# pdf_default_dpi = 72

# Enable rst2pdf extension modules (default is only vectorpdf)
# you need vectorpdf if you want to use sphinx's graphviz support
#pdf_extensions = ['vectorpdf']
# pdf_extensions = ['vectorpdf']

# Page template name for "regular" pages
#pdf_page_template = 'cutePage'
# pdf_page_template = 'cutePage'

# Show Table Of Contents at the beginning?
#pdf_use_toc = True
# pdf_use_toc = True

# How many levels deep should the table of contents be?
pdf_toc_depth = 9999
Expand Down