The Python document processor
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc Custom template/stylesheet for the rinohtype docs May 28, 2018
examples rinoh: avoid encoding issues Oct 27, 2016
icons Icons: include SVG and a script to generate icons Dec 16, 2016
macapp Use the full version number for the Mac app bundle Apr 5, 2017
src/rinoh Allow specifying selector priority in style sheets Jun 7, 2018
tests FlowableStyle: add width attribute Apr 3, 2018
tests_regression Minimal Sphinx test: hide date on the title page Jun 7, 2018
.bumpversion.cfg Use the full version number for the Mac app bundle Apr 5, 2017
.coveragerc Coverage: print a coverage report to the terminal Feb 27, 2017
.gitattributes properly set up end-of-line normalization May 1, 2013
.gitignore git: ignore the .pytest_cache directory May 28, 2018
.gitmodules Add a regression test based on the Sphinx frontend Jul 19, 2016
.travis.yml Travis CI: make poppler work on Ubuntu trusty Dec 29, 2017
CHANGES.rst Allow specifying selector priority in style sheets Jun 7, 2018
CONTRIBUTING.rst Motivate the use of a CLA (#117) Feb 16, 2018
Dockerfile Docker file to create an image matching a Travis worker Jul 7, 2016
LICENSE preparing for the first release Aug 17, 2013
MANIFEST.in Replace run_tests.sh with Python script Feb 14, 2017
README.rst Remove the QuantifiedCode badge Feb 16, 2018
appveyor.yml Python 3.3 reached end-of-life Dec 29, 2017
gitlabpypi.py GitLab PyPI: find all Markdown links Dec 22, 2016
macapp.py Use the full version number for the Mac app bundle Apr 5, 2017
run_tests.py Coverage: print a coverage report to the terminal Feb 27, 2017
setup.cfg Drop support for 'python setup.py test' Oct 28, 2016
setup.py Python 3.3 reached end-of-life Dec 29, 2017
tox.ini Python 3.3 reached end-of-life Dec 29, 2017
wininst.cfg Windows installer: set the publisher name Apr 5, 2017
wininst.py tox wininst: --pro for DITA support Dec 16, 2016

README.rst

rinohtype

PyPI Python version Gitter chat Build status Windows Build status Test coverage

Rinohtype is a document processor in the style of LaTeX. It renders structured 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. See the documentation to learn how to customize the style of your document.

Rinohtype is currently in a beta phase and thus not recommended for production use, but you can use it to explore rinohtype's features and bugs. I'd highly appreciate it if you could create a ticket for any bugs you may encounter. However, rinohtype is already very capable. Here is a list of its main features:

  • a powerful page layout system supporting columns, running headers/footers, floatable elements and footnotes
  • support for figures, and (large) tables
  • automatically generated table of contents and index
  • automatic numbering and cross-referencing of section headings, figures and tables
  • use 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 and small capitals
  • embeds PDF, PNG and JPEG images, preserving transparency and color profiles
  • easy to 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 obsoletes the need for a large LaTeX installation to produce PDF output. Have a look at the rinohtype documentation for an example of the output.

Please, be warned that some older versions of PDF readers have trouble displaying the PDFs generated by rinohtype (issue 2):

  • pre-37.0 Firefox's built-in PDF viewer (pdf.js)
  • pre-0.41 poppler-based applications such as Evince

Requirements

rinohtype supports Python 3.4 and up. For parsing reStructuredText and CommonMark documents, rinohtype depends on docutils and recommonmark respectively. pip takes care of these requirements when you install rinohtype. 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). You only need to add 'rinoh.frontend.sphinx' to the extensions list in conf.py. With this in place, you can select the rinoh builder when building the documentation:

sphinx-build -b rinoh . _build/rinoh

Contributing

See CONTRIBUTING.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).

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