From: Brecht M. <bre...@mo...> - 2016-08-10 17:08:54
|
Hi all, Rinohtype transforms structured text documents to PDF, styled based on a document template and style sheet. I have just released version 0.2.0. Along with many other changes [1], the included command line tool rinoh that renders reStructuredText documents has seen some improvements. It now allows specifying a document template and style sheet to use. It is relatively easy to write your own style sheet; see the documentation [2] for details. Quickstart: pip install rinohtype rinoh my_document.rst Please report any problems you may encounter at the project's GitHub page [3]. Besides the rinoh command-line tool rinohtype also includes a Sphinx builder which is a drop-in replacement for the LaTeX builder. Best regards, Brecht [1] http://www.mos6581.org/rinohtype/changelog.html#release-0-2-0-2016-08-09 [2] http://www.mos6581.org/rinohtype/ [3] https://github.com/brechtm/rinohtype/issues |
From: Paolo C. <cav...@fa...> - 2016-08-11 07:24:54
|
Il 10/08/2016 19:08, Brecht Machiels ha scritto: > > Hi all, > > Rinohtype transforms structured text documents to PDF, styled based on a > document template and style sheet. Thanks Brecht, looking forward to see it integrated in sphinx. I tried to install it, but I get a long series of errors [0] All the best. === [0] File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/stylesheets/matcher.py", line 25 / ... / StyledText.like('number'), ^ SyntaxError: invalid syntax File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/font/opentype/parse.py", line 70 def context_array(reader, count_key, *indirect_args, multiplier=1): ^ SyntaxError: invalid syntax File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/font/__init__.py", line 95 def __new__(cls, name, *fonts, weight_order=FontWeight.values): ^ SyntaxError: invalid syntax File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/frontend/epub/__init__.py", line 33 class EPubNode(ElementTreeNode, metaclass=ElementTreeNodeMeta): ^ SyntaxError: invalid syntax File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/frontend/docbook/__init__.py", line 20 class DocBookNode(ElementTreeNode, metaclass=ElementTreeNodeMeta): ^ SyntaxError: invalid syntax File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/frontend/rst/__init__.py", line 25 class DocutilsNode(TreeNode, metaclass=TreeNodeMeta): ^ SyntaxError: invalid syntax File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/template.py", line 93 metaclass=TemplateConfigurationMeta): ^ SyntaxError: invalid syntax File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/paragraph.py", line 403 nonlocal state, saved_state, max_line_width, descender ^ SyntaxError: invalid syntax File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/backend/pdf/__init__.py", line 153 def print(self, string): ^ SyntaxError: invalid syntax File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/backend/pdf/cos.py", line 337 def __init__(self, *args, indirect=False, **items): ^ SyntaxError: invalid syntax File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/flowable.py", line 662 def __init__(self, *args, align=None, width=None, **kwargs): ^ SyntaxError: invalid syntax File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/attribute.py", line 62 class OptionSet(AttributeType, metaclass=OptionSetMeta): ^ SyntaxError: invalid syntax File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/strings.py", line 43 class Strings(dict, metaclass=WithNamedDescriptors): ^ SyntaxError: invalid syntax File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/document.py", line 178 class DocumentPart(object, metaclass=DocumentLocationType): ^ SyntaxError: invalid syntax File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/dimension.py", line 53 class DimensionBase(AcceptNoneAttributeType, metaclass=DimensionType): ^ SyntaxError: invalid syntax File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/text.py", line 497 print(self.ps, file=box_canvas.psg_canvas) ^ SyntaxError: invalid syntax File "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/style.py", line 404 class Styled(DocumentElement, metaclass=StyledMeta): ^ SyntaxError: invalid syntax Installing rinoh script to /usr/local/src/py_virtual_experimental/bin Could not find .egg-info directory in install record for rinohtype -- Paolo Cavallini - www.faunalia.eu QGIS & PostGIS courses: http://www.faunalia.eu/training.html |
From: Brecht M. <bre...@mo...> - 2016-08-11 07:49:58
|
Hi Paolo, Thanks for giving rinohtype a spin. Rinohtype only supports Python 3.3+. I see you are running it on Python 2.7. I'll see if I can have pip (and easy_install) abort with a clear error message when someone tries to install it on an unsupported Python version. Best regards, Brecht On Thu, 11 Aug 2016 09:07:12 +0200, Paolo Cavallini <cav...@fa...> wrote: > Il 10/08/2016 19:08, Brecht Machiels ha scritto: >> >> Hi all, >> >> Rinohtype transforms structured text documents to PDF, styled based on a >> document template and style sheet. > > Thanks Brecht, > looking forward to see it integrated in sphinx. I tried to install it, > but I get a long series of errors [0] > All the best. > === > [0] > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/stylesheets/matcher.py", > line 25 > / ... / StyledText.like('number'), > ^ > SyntaxError: invalid syntax > > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/font/opentype/parse.py", > line 70 > def context_array(reader, count_key, *indirect_args, > multiplier=1): > ^ > SyntaxError: invalid syntax > > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/font/__init__.py", > line 95 > def __new__(cls, name, *fonts, weight_order=FontWeight.values): > ^ > SyntaxError: invalid syntax > > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/frontend/epub/__init__.py", > line 33 > class EPubNode(ElementTreeNode, metaclass=ElementTreeNodeMeta): > ^ > SyntaxError: invalid syntax > > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/frontend/docbook/__init__.py", > line 20 > class DocBookNode(ElementTreeNode, > metaclass=ElementTreeNodeMeta): > ^ > SyntaxError: invalid syntax > > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/frontend/rst/__init__.py", > line 25 > class DocutilsNode(TreeNode, metaclass=TreeNodeMeta): > ^ > SyntaxError: invalid syntax > > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/template.py", > line 93 > metaclass=TemplateConfigurationMeta): > ^ > SyntaxError: invalid syntax > > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/paragraph.py", > line 403 > nonlocal state, saved_state, max_line_width, descender > ^ > SyntaxError: invalid syntax > > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/backend/pdf/__init__.py", > line 153 > def print(self, string): > ^ > SyntaxError: invalid syntax > > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/backend/pdf/cos.py", > line 337 > def __init__(self, *args, indirect=False, **items): > ^ > SyntaxError: invalid syntax > > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/flowable.py", > line 662 > def __init__(self, *args, align=None, width=None, **kwargs): > ^ > SyntaxError: invalid syntax > > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/attribute.py", > line 62 > class OptionSet(AttributeType, metaclass=OptionSetMeta): > ^ > SyntaxError: invalid syntax > > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/strings.py", > line 43 > class Strings(dict, metaclass=WithNamedDescriptors): > ^ > SyntaxError: invalid syntax > > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/document.py", > line 178 > class DocumentPart(object, metaclass=DocumentLocationType): > ^ > SyntaxError: invalid syntax > > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/dimension.py", > line 53 > class DimensionBase(AcceptNoneAttributeType, > metaclass=DimensionType): > ^ > SyntaxError: invalid syntax > > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/text.py", > line 497 > print(self.ps, file=box_canvas.psg_canvas) > ^ > SyntaxError: invalid syntax > > File > "/usr/local/src/py_virtual_experimental/lib/python2.7/site-packages/rinoh/style.py", > line 404 > class Styled(DocumentElement, metaclass=StyledMeta): > ^ > SyntaxError: invalid syntax > > Installing rinoh script to /usr/local/src/py_virtual_experimental/bin > Could not find .egg-info directory in install record for rinohtype |
From: Paolo C. <cav...@fa...> - 2016-08-11 08:08:31
|
Il 11/08/2016 09:49, Brecht Machiels ha scritto: > Hi Paolo, > > Thanks for giving rinohtype a spin. > > Rinohtype only supports Python 3.3+. I see you are running it on Python > 2.7. I'll see if I can have pip (and easy_install) abort with a clear > error message when someone tries to install it on an unsupported Python > version. Oh, I see. I'll set up a virtualenv with Py3 then. Thanks. -- Paolo Cavallini - www.faunalia.eu QGIS & PostGIS courses: http://www.faunalia.eu/training.html |
From: Paolo C. <cav...@fa...> - 2016-08-11 15:48:05
Attachments:
signature.asc
|
Il 11/08/2016 10:08, Paolo Cavallini ha scritto: > Oh, I see. I'll set up a virtualenv with Py3 then. Done, it works reasonably well, but figures are not resized correctly, and sometimes flow over the borders of the page. Thanks. -- Paolo Cavallini - www.faunalia.eu QGIS & PostGIS courses: http://www.faunalia.eu/training.html |
From: Brecht M. <bre...@mo...> - 2016-08-11 16:21:11
|
Hi, On Thu, 11 Aug 2016 17:47:57 +0200, Paolo Cavallini <cav...@fa...> wrote: > Il 11/08/2016 10:08, Paolo Cavallini ha scritto: > >> Oh, I see. I'll set up a virtualenv with Py3 then. > > Done, it works reasonably well, but figures are not resized correctly, > and sometimes flow over the borders of the page. > Thanks. Are you talking about rinoh or the Sphinx builder? Did you set a size or scale option for the figures? Please create a bug report [1] and provide a small example that illustrates the problem. Best regards, Brecht [1] https://github.com/brechtm/rinohtype/issues |
From: Paolo C. <cav...@fa...> - 2016-08-12 07:03:24
|
Hi Brecht, Il 11/08/2016 18:20, Brecht Machiels ha scritto: > Are you talking about rinoh or the Sphinx builder? the rinoh Sphinx builder > Did you set a size or scale option for the figures? I didn't. Just used the same settings as for the Latexpdf builder, with plain .. image:: directive Shouldn't rinoh have the same output as the latex one? What would be the suggested settings? > Please create a bug report [1] and provide a small example that > illustrates the problem. > [1] https://github.com/brechtm/rinohtype/issues Will do, when I understand the above points. Thanks. -- Paolo Cavallini - www.faunalia.eu QGIS & PostGIS courses: http://www.faunalia.eu/training.html |
From: Brecht M. <bre...@mo...> - 2016-08-12 14:24:17
|
Hi Paolo, On Fri, 12 Aug 2016 09:03:16 +0200, Paolo Cavallini <cav...@fa...> wrote: >> Did you set a size or scale option for the figures? > > I didn't. Just used the same settings as for the Latexpdf builder, with > plain .. image:: directive > Shouldn't rinoh have the same output as the latex one? > What would be the suggested settings? Rinohtype respects an image's embedded DPI setting. If no DPI value is present in the image, a default of 72 DPI is used. I have tried rendering the Lizmap documentation [1]. I don't suppose it is this project you tried to render using rinohtype, since it triggers a bug (#47) aborting the rendering process? In addition to this bug it revealed another bug (#45) and indeed illustrates the difference with LaTeX output (#46). I plan to deal with these issues in a bugfix release 0.2.1 [2]. Please subscribe to these issues if you wish to receive updates about them. You're also welcome to share your ideas about #46 by adding comments, of course. Best regards, Brecht [1] https://github.com/3liz/lizmap-documentation [2] https://github.com/brechtm/rinohtype/milestone/3 |
From: Paolo C. <cav...@fa...> - 2016-08-12 14:48:20
|
Hi Brecht, Il 12/08/2016 16:24, Brecht Machiels ha scritto: > Rinohtype respects an image's embedded DPI setting. If no DPI value is > present in the image, a default of 72 DPI is used. Thanks for the clarification. > I have tried rendering the Lizmap documentation [1]. I don't suppose it is > this project you tried to render using rinohtype, since it triggers a bug > (#47) aborting the rendering process? Not, I have a variety of docs that I compile often using Sphinx. > In addition to this bug it revealed another bug (#45) and indeed > illustrates the difference with LaTeX output (#46). I plan to deal with > these issues in a bugfix release 0.2.1 [2]. Please subscribe to these > issues if you wish to receive updates about them. You're also welcome to > share your ideas about #46 by adding comments, of course. > [1] https://github.com/3liz/lizmap-documentation > [2] https://github.com/brechtm/rinohtype/milestone/3 Done, thanks. All the best. -- Paolo Cavallini - www.faunalia.eu QGIS & PostGIS courses: http://www.faunalia.eu/training.html |
From: Brecht M. <bre...@mo...> - 2016-08-19 08:04:48
|
On Fri, 12 Aug 2016 16:24:01 +0200, Brecht Machiels <bre...@mo...> wrote: > I have tried rendering the Lizmap documentation [1]. I don't suppose it > is > this project you tried to render using rinohtype, since it triggers a bug > (#47) aborting the rendering process? > > In addition to this bug it revealed another bug (#45) and indeed > illustrates the difference with LaTeX output (#46). I plan to deal with > these issues in a bugfix release 0.2.1 [2]. Please subscribe to these > issues if you wish to receive updates about them. You're also welcome to > share your ideas about #46 by adding comments, of course. Release 0.2.1 [1] fixes these issues. Just like the LaTeX builder, the rinohtype Sphinx builder now scales down images that are wider than the text width. However, it does not copy the strange handling of the image directive's :scale: option [2]. To obtain the same effect, you should pass a percentage to the :width: option. Best regards, Brecht [1] https://pypi.python.org/pypi/RinohType/0.2.1 [2] https://github.com/sphinx-doc/sphinx/issues/2865 |