Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
  • Loading branch information
brechtm committed Aug 25, 2016
2 parents 3478f0b + a105e93 commit 23626fc
Show file tree
Hide file tree
Showing 22 changed files with 22,108 additions and 26,421 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ matrix:
- export LD_LIBRARY_PATH=$HOME/.local/lib
- python: 3.5
env: TOXENV=test-docs
- python: 3.5
env: TOXENV=build-docs

install:
- pip install tox-travis wheel
Expand Down
11 changes: 11 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ Release 0.3.0.dev
Release 0.2.2.dev
~~~~~~~~~~~~~~~~~

Changed:

* rename FieldList to DefinitionList and use it to replace uses (docutils and
Sphinx frontends) of the old DefinitionList (#54)
* Sphinx style sheet: copy the admonition style from the Sphinx LaTeX builder

Fixed:

* GroupedLabeledFlowables label width could unnecessarily be too wide
* reStructuredText: only the first classifier for a definition term was shown

Release 0.2.1 (2016-08-18)
~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
20 changes: 15 additions & 5 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,21 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import time

from distutils.core import run_setup

import pkg_resources

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('..'))

import rinoh
SETUP = os.path.join(os.path.dirname(__file__), '..', 'setup.py')

distribution = run_setup(SETUP, stop_after='init')

# -- General configuration ------------------------------------------------

Expand Down Expand Up @@ -55,18 +61,22 @@
master_doc = 'index'

# General information about the project.
project = 'rinohtype'
copyright = '2015, Brecht Machiels'
project = distribution.get_name()
author = distribution.get_author()
copyright = '{}, {}'.format(time.strftime('%Y'), author)

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = rinoh.__version__
release = version = distribution.get_version()
# The full version, including alpha/beta/rc tags.
release = version

# make sure the installed rinohtype version corresponds to the docs
assert version == pkg_resources.get_distribution(project).version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
Expand Down
15 changes: 15 additions & 0 deletions doc/faq.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.. _faq:

Frequenty Asked Questions
=========================

PDFs produced by rinohtype contain mostly empty pages. What's up?
Old versions of some PDF viewers do not support the way rinohtype embeds
fonts in a PDF (see `issue 2`_). PDF viewers that are known to be affected
are:

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

.. _issue 2: https://github.com/brechtm/rinohtype/issues/2
.. _poppler: http://poppler.freedesktop.org
3 changes: 2 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ technical documents.
Paired with Sphinx_, rinohtype offers a modern alternative to LaTeX_ . Sphinx
helps writing large structured documents and supports a multitude of different
output formats including searchable HTML. Rinohtype provides a Sphinx backend
that allows generating beautiful PDF documents.
that allows generating professionally typeset PDF documents.

.. _Sphinx: http://sphinx-doc.org
.. _LaTeX: http://en.wikipedia.org/wiki/LaTeX
Expand Down Expand Up @@ -63,6 +63,7 @@ projects involving rinohtype, so please don't hesitate to contact us.
templates
advanced
api/index
faq
changelog


Expand Down
4 changes: 3 additions & 1 deletion doc/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ This can be used to render reStructuredText_ documents such as `demo.txt`_::

rinoh demo.txt

After rendering finishes, you will find ``demo.pdf`` alongside the input file.
After rendering finishes, you will find
:download:`demo.pdf <../tests_regression/reference/demo.pdf>` alongside the
input file.

:program:`rinoh` allows specifying the document template and style sheet to use
when rendering the reStructuredText document. See its :ref:`command-line
Expand Down
1 change: 0 additions & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
sphinx
sphinxcontrib-autoprogram
rinohtype
13 changes: 6 additions & 7 deletions setup.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
#!/bin/env python
#!/usr/bin/env python

"""
Setup script for rinohtype
"""

import os
import sys

from setuptools import setup, find_packages


BASE_PATH = os.path.dirname(os.path.abspath(__file__))


if sys.version_info < (3, 3):
print('rinohtype requires Python 3.3 or higher')
sys.exit(1)


def long_description():
with open(os.path.join(BASE_PATH, 'README.rst')) as readme:
import os

base_path = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(base_path, 'README.rst')) as readme:
result = readme.read()
result += '\n\n'
with open(os.path.join(BASE_PATH, 'CHANGES.rst')) as changes:
with open(os.path.join(base_path, 'CHANGES.rst')) as changes:
result += changes.read()
return result

Expand Down
52 changes: 42 additions & 10 deletions src/rinoh/data/stylesheets/sphinx.rts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ font_weight=BOLD
[literal strong]
base=strong
typeface=$(mono_typeface)
hyphenate=False
ligatures=False

[quote]
font_slant=italic
Expand Down Expand Up @@ -314,6 +316,10 @@ indent_first=0pt

[definition list]

[definition list item]
label_min_width=17pt
label_max_width=none

[definition term]
space_above=4pt
keep_with_next=true
Expand All @@ -325,9 +331,9 @@ font_weight=BOLD

[definition term classifier]
font_weight=REGULAR
font_slant=italic

[definition]
margin_left=20pt

[definition paragraph]
base=body
Expand All @@ -342,14 +348,17 @@ font_slant=ITALIC
# (Sphinx) object descriptions

[object description]
base=definition list item
space_above=3pt
space_below=3pt
label_max_width=none

[object definition term]
[object signatures]
base=definition term

[object signature]
base=default
base=definition term paragraph
font_weight=regular

[object name]
typeface=$(mono_typeface)
Expand Down Expand Up @@ -414,6 +423,11 @@ space_below=0

# field lists

[field list]

[field list item]
label_max_width=80pt

[field name]
base=default
indent_first=0
Expand All @@ -423,6 +437,11 @@ font_weight=BOLD

# option lists

[option list]

[option list item]
base=field list item

[option]
base=body
indent_first=0
Expand All @@ -448,6 +467,7 @@ border_bottom=$(thin_black_stroke)

[admonition title]
base=default
keep_with_next=true
font_weight=BOLD
indent_first=0
space_above=5pt
Expand All @@ -459,6 +479,9 @@ base=admonition title
[builtin admonition:Admonition]
base=admonition
inline_title=true

[boxed builtin admonition:Admonition]
base=builtin admonition
border=$(thin_black_stroke)
padding_left=8pt
padding_right=8pt
Expand All @@ -468,28 +491,37 @@ base=admonition title
font_color=#f00

[attention admonition]
base=builtin admonition
base=boxed builtin admonition

[caution admonition]
base=builtin admonition
base=boxed builtin admonition

[danger admonition]
base=builtin admonition
base=boxed builtin admonition

[warning admonition]
base=boxed builtin admonition

[error admonition]
base=boxed builtin admonition

[hint admonition]
base=builtin admonition

[warning admonition]
[important admonition]
base=builtin admonition

[note admonition]
base=builtin admonition

[tip admonition]
base=builtin admonition

[seealso admonition]
base=admonition
border_top=none
border_bottom=none

[tip admonition]
base=builtin admonition

[header_footer:Paragraph]
base=default
typeface=$(sans_typeface)
Expand Down
Loading

0 comments on commit 23626fc

Please sign in to comment.