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="3,0" stop="3,0" colorName="black"/>
<lineStyle kind="linebelow" start="5,0" stop="5,0" colorName="black"/> <lineStyle kind="linebelow" start="5,0" stop="5,0" colorName="black"/>
</blockTableStyle> </blockTableStyle>
<listStyle name="ol"
bulletFormat="%s."
bulletFontSize="10" />
<listStyle name="ul"
start="square"
bulletFontSize="8" />
</stylesheet> </stylesheet>
<template > {# Note: page is 595x842 points (1 point=1/72in) #} <template > {# Note: page is 595x842 points (1 point=1/72in) #}

View File

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

Binary file not shown.