Skip to content

Commit

Permalink
Support for ordered list bullet types.
Browse files Browse the repository at this point in the history
Conflicts:
	CHANGES.rst
	setup.py
  • Loading branch information
strichter committed Sep 10, 2014
1 parent dc1657f commit 32ddf14
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 9 deletions.
6 changes: 4 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
CHANGES
=======

2.6.1 (unreleased)
2.7.0 (unreleased)
------------------

- Nothing changed yet.
- Added ``bulletType`` sypport for the ``listStyle`` tag.

- Added "bullet" as a valid unordered list type value.


2.6.0 (2014-07-24)
Expand Down
5 changes: 4 additions & 1 deletion buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,7 @@ PyPDF2 = 1.21
lxml = 3.3.5
reportlab = 3.1.8
zope.interface = 4.1.1
zope.component = 4.2.1
# Use older version of zope.component, since zope.interface gets picked up
# from Ubuntu system install.
zope.component = 4.0.0
zope.pagetemplate = 4.0.4
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ def alltests():
]

setup (
name='z3c.rml',
version='2.6.1.dev0',
version='2.7.0dev',
author="Stephan Richter and the Zope Community",
author_email="zope-dev@zope.org",
description="An alternative implementation of RML",
Expand Down
3 changes: 2 additions & 1 deletion src/z3c/rml/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
TEXT_TRANSFORM_CHOICES = ('uppercase', 'lowercase')
LIST_FORMATS = ('I', 'i', '123', 'ABC', 'abc')
ORDERED_LIST_TYPES = ('I', 'i', '1', 'A', 'a')
UNORDERED_BULLET_VALUES = ('circle', 'square', 'disc', 'diamond', 'rarrowhead')
UNORDERED_BULLET_VALUES = ('bullet', 'circle', 'square', 'disc', 'diamond',
'rarrowhead')
LOG_LEVELS = {
'DEBUG': logging.DEBUG,
'INFO': logging.INFO,
Expand Down
3 changes: 2 additions & 1 deletion src/z3c/rml/pagetemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

try:
import zope.pagetemplate.pagetemplatefile
except ImportError:
except ImportError, err:
raise
# zope.pagetemplate package has not been installed
import types
zope.pagetemplate = types.ModuleType('pagetemplate')
Expand Down
Binary file modified src/z3c/rml/rml-reference.pdf
Binary file not shown.
8 changes: 6 additions & 2 deletions src/z3c/rml/rml.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@
<!ATTLIST listStyle bulletDedent CDATA #IMPLIED>
<!ATTLIST listStyle bulletDir (ltr|rtl) #IMPLIED>
<!ATTLIST listStyle bulletFormat CDATA #IMPLIED>
<!ATTLIST listStyle bulletType (A|a|square|bullet|rarrowhead|I|diamond|1|i|disc|circle) #IMPLIED>
<!ATTLIST listStyle start CDATA #IMPLIED>
<!ATTLIST listStyle name CDATA #REQUIRED>
<!ATTLIST listStyle parent CDATA #IMPLIED>
Expand Down Expand Up @@ -896,6 +897,7 @@
<!ATTLIST li bulletDedent CDATA #IMPLIED>
<!ATTLIST li bulletDir (ltr|rtl) #IMPLIED>
<!ATTLIST li bulletFormat CDATA #IMPLIED>
<!ATTLIST li bulletType (A|a|square|bullet|rarrowhead|I|diamond|1|i|disc|circle) #IMPLIED>
<!ATTLIST li style CDATA #IMPLIED>
<!ATTLIST li value CDATA #IMPLIED>

Expand All @@ -909,9 +911,10 @@
<!ATTLIST ul bulletDedent CDATA #IMPLIED>
<!ATTLIST ul bulletDir (ltr|rtl) #IMPLIED>
<!ATTLIST ul bulletFormat CDATA #IMPLIED>
<!ATTLIST ul bulletType (A|a|square|bullet|rarrowhead|I|diamond|1|i|disc|circle) #IMPLIED>
<!ATTLIST ul start CDATA #IMPLIED>
<!ATTLIST ul style CDATA #IMPLIED>
<!ATTLIST ul value (disc|rarrowhead|circle|square|diamond) #IMPLIED>
<!ATTLIST ul value (square|bullet|diamond|rarrowhead|disc|circle) #IMPLIED>

<!ELEMENT li>
<!ATTLIST li leftIndent CDATA #IMPLIED>
Expand All @@ -923,8 +926,9 @@
<!ATTLIST li bulletDedent CDATA #IMPLIED>
<!ATTLIST li bulletDir (ltr|rtl) #IMPLIED>
<!ATTLIST li bulletFormat CDATA #IMPLIED>
<!ATTLIST li bulletType (A|a|square|bullet|rarrowhead|I|diamond|1|i|disc|circle) #IMPLIED>
<!ATTLIST li style CDATA #IMPLIED>
<!ATTLIST li value (disc|rarrowhead|circle|square|diamond) #IMPLIED>
<!ATTLIST li value (square|bullet|diamond|rarrowhead|disc|circle) #IMPLIED>

<!ELEMENT includePdfPages>
<!ATTLIST includePdfPages filename CDATA #REQUIRED>
Expand Down
8 changes: 8 additions & 0 deletions src/z3c/rml/stylesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,14 @@ class IMinimalListStyle(interfaces.IRMLDirectiveSignature):
description=u'A formatting expression for the bullet text.',
required=False)

bulletType = attr.Choice(
title=u'Bullet Type',
description=u'The type of number to display.',
choices=interfaces.ORDERED_LIST_TYPES + \
interfaces.UNORDERED_BULLET_VALUES,
doLower=False,
required=False)

class IBaseListStyle(IMinimalListStyle):

start = attr.Combination(
Expand Down
Binary file modified src/z3c/rml/tests/expected/rml-examples-046-lists.pdf
Binary file not shown.
Binary file modified src/z3c/rml/tests/expected/tag-ul-ol-li.pdf
Binary file not shown.
17 changes: 17 additions & 0 deletions src/z3c/rml/tests/input/tag-ul-ol-li.rml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
start="diamond"
doc:example=""
/>
<listStyle
name="MyEnum"
bulletFontName="Helvetica-Bold"
bulletFontSize="8"
bulletFormat="(%s)"
bulletType="a"
doc:example=""
/>
</stylesheet>

<story>
Expand Down Expand Up @@ -66,6 +74,15 @@
<li><para>Two</para></li>
<li><para>Three</para></li>
</ul>

<spacer length="0.5in" />

<ol style="MyEnum">
<li><para>One</para></li>
<li><para>Two</para></li>
<li><para>Three</para></li>
</ol>

</story>

</document>

0 comments on commit 32ddf14

Please sign in to comment.