Skip to main content

The Python document processor

Project description

PyPI Python version Gitter chat Tests Test coverage

rinohtype is a batch-mode document processor. It renders structured documents to PDF based on a document template and a style sheet. An important design goal of rinohtype is make document layout and style customization user-friendly. See the documentation to learn how to customize the style of your document.

Call for Contributions

Since rinohtype is a fairly sizable project and currently being maintained by a single person, your contribution can make a big difference. Specifically, the following things can help move rinohtype forward:

  • development of professional-looking stylesheets and document templates

  • volunteering to be a maintainer: fix issues that pop up when new versions of dependencies are released (Python, Sphinx, …)

  • help with maintaining and improving the documentation

  • development of new features, e.g. widow/orphan handling, Knuth-Plass line breaking, mathematics typesetting, performance improvements, …

  • companies might be interested in funding the development of particular features

So if you are interested in helping with any of these items, please don’t hesitate to get in touch via brecht@opqode.com, GitHub issues or Gitter!

Features

rinohtype is still in beta, so you might run into some issues when using it. I’d highly appreciate it if you could create a ticket for any bugs you may encounter. That said, rinohtype is already quite capable. For example, it should be able to replace Sphinx’s LaTeX builder in most cases. Here is an overview of the main features:

  • a powerful page layout system supporting columns, running headers/footers, floatable elements and footnotes

  • support for figures and (large) tables

  • automatic generation of table of contents and index

  • automatic numbering and cross-referencing of section headings, figures and tables

  • configure one of the included document templates or create your own

  • an intuitive style sheet system inspired by CSS

  • modular design allowing for multiple frontends (such as reStructuredText, Markdown, DocBook, …)

  • handles OpenType, TrueType and Type1 fonts with support for advanced typographic features such as kerning, ligatures, small capitals and old style figures

  • embeds PDF, PNG and JPEG images, preserving transparency and color profiles

  • easy to install and deploy; pure-Python with few dependencies

  • built on Unicode; ready for non-latin languages

rinohtype’s primary input format is reStructuredText. The rinoh command line tool renders reStructuredText documents and the included Sphinx builder makes it possible to output large documents with your own style applied. Have a look at the rinohtype manual for an example of the output.

There is also a commercial DITA frontend, but it’s development is currently on hold. Please contact me if you are interested in testing it.

Requirements

rinohtype supports all stable Python 3 versions that have not reached end-of-life status. For parsing reStructuredText and CommonMark documents, rinohtype depends on docutils and recommonmark respectively. pip takes care of installing these requirements when you install rinohtype.

Syntax highlighting of code blocks is eneabled if Pygments is installed, which will be installed automatically with Sphinx. If you want to include images other than PDF, PNG or JPEG, you also need to install Pillow.

Getting Started

Installation is trivial:

pip install rinohtype

reStructuredText Renderer

The easiest way to get started with rinohtype is to render a reStructuredText document (such as CHANGES.rst from this repository) using the rinoh command line tool:

rinoh CHANGES.rst

When rinoh finishes, you will find CHANGES.pdf alongside the input file.

By default rinoh renders the input document using the article template. Run rinoh --help to see how you can tell rinoh which document template and style sheet to use.

Sphinx Builder

rinohtype can be used as a drop-in replacement for the LaTeX builder (the latex_documents configuration variable has to be set). Simply select the rinoh builder when building the Sphinx project:

sphinx-build -b rinoh . _build/rinoh

Contributing

See CONTRIBUTING.rst and DEVELOPING.rst

License

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

The Affero GPL requires for software that builds on rinohtype to also be released as open source under this license. For building closed-source applications, you can obtain a commercial license. The author of rinohtype is also available for consultancy projects involving rinohtype.

Project details


Download files

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

Source Distribution

rinohtype-0.5.3.tar.gz (3.3 MB view details)

Uploaded Source

Built Distribution

rinohtype-0.5.3-py3-none-any.whl (604.0 kB view details)

Uploaded Python 3

File details

Details for the file rinohtype-0.5.3.tar.gz.

File metadata

  • Download URL: rinohtype-0.5.3.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.5 Linux/5.8.0-1033-azure

File hashes

Hashes for rinohtype-0.5.3.tar.gz
Algorithm Hash digest
SHA256 7b4dea40df49a7f623ad0382b3802cb72a7e72d0e30facba135cd86b977b5762
MD5 c26b08054f5eb2d1e5160b71c189834b
BLAKE2b-256 2b4ff9b9878ca66e25941b4c56b12abfca41f04b133bf0d61adbf29a363dbb84

See more details on using hashes here.

Provenance

File details

Details for the file rinohtype-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: rinohtype-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 604.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.5 Linux/5.8.0-1033-azure

File hashes

Hashes for rinohtype-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8bd4f0dd188026ede65286eab4bcfb3bffc594fe4bca7cf1f0125ccd35ff995a
MD5 d17a25c6b98ab937242e764fbce8890b
BLAKE2b-256 5f1296f564c61b1ac23a8927a40af5b4207e80dd87c73b28060f1d6aea772201

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