Add OL processing to RML

This commit is contained in:
Tom Price
2016-01-07 20:12:04 +00:00
parent 2d3262cb0b
commit b46023c522
3 changed files with 13 additions and 6 deletions

View File

@@ -77,6 +77,14 @@
<lineStyle kind="linebelow" start="3,0" stop="3,0" colorName="black"/>
<lineStyle kind="linebelow" start="5,0" stop="5,0" colorName="black"/>
</blockTableStyle>
<listStyle name="ol"
bulletFormat="%s."
bulletFontSize="10" />
<listStyle name="ul"
start="square"
bulletFontSize="8" />
</stylesheet>
<template > {# Note: page is 595x842 points (1 point=1/72in) #}
@@ -128,4 +136,4 @@
{% include "RIGS/event_print_page.xml" %}
</story>
</document>
</document>

View File

@@ -30,10 +30,9 @@ def markdown_filter(text, format='html'):
bq.name = 'pre'
bq.string = bq.text
for ul in soup('ul'):
ul['value'] = 'square'
ul['bulletFontSize'] = '8'
for li in ul.findAll('li'):
for list in soup.findAll(['ul','ol']):
list['style'] = list.name
for li in list.findAll('li'):
p = soup.new_tag('p')
p.string = li.text
li.string = ''
@@ -41,7 +40,7 @@ def markdown_filter(text, format='html'):
indent = soup.new_tag('indent')
indent['left'] = '1.2cm'
content = ul.replace_with(indent)
content = list.replace_with(indent)
indent.append(content)
# Paragraphs have a different tag