Skip to content

Commit

Permalink
Get version of reference manual from package version.
Browse files Browse the repository at this point in the history
  • Loading branch information
strichter committed Feb 3, 2015
1 parent 4f86202 commit 3502936
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ CHANGES
2.8.0 (unreleased)
------------------

- Get version of reference manual from package version.

- Added the ability to specify any set of characters as the "bullet content"
like it is supported by ReportLab.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def alltests():

setup (
name="z3c.rml",
version='2.7.3.dev0',
version='2.8.0',
author="Stephan Richter and the Zope Community",
author_email="zope-dev@zope.org",
description="An alternative implementation of RML",
Expand Down
2 changes: 2 additions & 0 deletions src/z3c/rml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import z3c.rml.paraparser
import z3c.rml.rlfix

import pkg_resources
__version__ = pkg_resources.require('z3c.rml')[0].version

from reportlab.lib.styles import getSampleStyleSheet
SampleStyleSheet = getSampleStyleSheet()
2 changes: 1 addition & 1 deletion src/z3c/rml/reference.pt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
</drawCenteredString>
<setFont name="Helvetica" size="24" />
<drawCenteredString x="10.5cm" y="18.5cm">
Version 2.1
Version <tal:block replace="context/version" />
</drawCenteredString>
</pageGraphics>
<frame id="main" x1="3cm" y1="2cm" width="17cm" height="25.7cm" />
Expand Down
7 changes: 5 additions & 2 deletions src/z3c/rml/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from lxml import etree
from xml.sax import saxutils
from pygments.lexers import XmlLexer
from z3c.rml import attr, document, interfaces, pagetemplate
from z3c.rml import attr, document, interfaces, pagetemplate, __version__


INPUT_URL = ('https://github.com/zopefoundation/z3c.rml/blob/master/src/z3c/'
Expand Down Expand Up @@ -238,5 +238,8 @@ def main(outPath=None):
processSignature('document', document.IDocument, examples, directives)
directives = sorted(directives.values(), key=lambda d: d['name'])

pdf = template(types=getAttributeTypes(), directives=directives)
pdf = template(
version=__version__,
types=getAttributeTypes(),
directives=directives)
open(outPath or 'rml-reference.pdf', 'wb').write(pdf)
Binary file modified src/z3c/rml/rml-reference.pdf
Binary file not shown.

0 comments on commit 3502936

Please sign in to comment.