Skip to main content

The Python document processor

Project description

RinohType is a document processor in the style of LaTeX. It can render structured text documents to PDF based on a document template and a style sheet. An important goal of RinohType is to be more user-friendly than LaTeX. This includes providing clear error messages and making it very easy to adjust the document style.

RinohType is currently in a near-beta phase and thus unsuited for production use, but you can use it to explore RinohType’s features and bugs. I’d highly appreciate if you could create a ticket for any bugs you encounter. You can find some articles on my blog discussing RinohType’s development progress.

Currently, RinohType only supports reStructuredText input. It ships with the rinoh command line tool to render basic reStructuredText documents and a Sphinx builder to render more complex documents. The included document templates and style sheets are fairly basic but these will be improved in the future.

Please be warned that some PDF readers have trouble displaying the PDFs generated by RinohType (issue 2). I believe this is due to a bug in these PDF readers. The following PDF viewers are affected:

  • Firefox’s built-in PDF viewer (pdf.js)

  • Evince and other poppler-based applications (e.g. Zathura)

Requirements

RinohType currently only runs on Python 3.2 and up. It might be back-ported to Python 2.7 at some point in the future, but this is not certain.

For parsing reStructuredText documents RinohType depends on docutils. For parsing PNG images we require pure-Python PurePNG. pip takes care of these requirement when you install RinohType. If you want to include images other than PDF, PNG or JPEG, you will need Pillow.

Getting Started

Command-line reStructuredText renderer

The easiest way to get started with RinohType is to render a reStructuredText document (such as demo.txt) using the rinoh command line tool:

rinoh demo.txt

When the script finishes, you will find demo.pdf alongside the input file.

rinoh renders the input document using the article template. You can specify the paper size using the --paper command line argument.

Sphinx Builder

To use RinohType to render Sphinx documents, you need to adjust the Sphinx project’s conf.py:

  1. add rinoh.frontend.sphinx to the extensions list, and

  2. set the rinoh_documents configuration option:

    rinoh_documents = [('index',          # top-level rst file (index.rst)
                        'target',         # output (sphinx.pdf)
                        'Document Title,  # document title
                        'Author')]        # document author
  3. now we can select the rinoh builder when building the documentation:

    sphinx-build -b rinoh . _build/rinoh

License

All of RinohType’s source code is licensed under the Affero GPL, unless indicated otherwise in the source file (such as hyphenator.py).

My intention is to make RinohType free for non-commercial use and offer a separate license for commercial use. The AGPL will likely be replaced soon with another license to better reflect this intention.

Changelog

Release 0.1.3 (2015-08-04)

  • recover from the slow rendering speed caused by a bugfix in 0.1.2 (thanks to optimized element matching in the style sheets)

  • other improvements and bugfixes related to style sheets

Release 0.1.2 (2015-07-31)

  • much improved Sphinx support (we can now render the Sphinx documentation)

  • more complete support for reStructuredText (docutils) elements

  • various fixes related to footnote placement

  • page break option when starting a new section

  • fixes in handling of document sections and parts

  • improvements to section/figure/table references

  • native support for PNG and JPEG images (drops PIL/Pillow requirement, but adds PurePNG 0.1.1 requirement)

  • new ‘sphinx’ stylesheet used by the Sphinx builder (~ Sphinx LaTeX style)

  • restores Python 3.2 compatibility

Release 0.1.1 (2015-04-12)

First preview release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

RinohType-0.1.3-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

Details for the file RinohType-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for RinohType-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 89b6305bd21c82f7759861eb21f0cefae755627112aa548146da994a7d64c3cf
MD5 22d8a1f81bb03d58efd4732b6bb437e7
BLAKE2b-256 a703faf55cf86f69b1b1b738c81ba12833cb1d1b978799e66456abe495c34580

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page