add a new "note for toc" style, that adds text to the table of contents (#390)

This commit is contained in:
Frédéric Péters 2011-04-27 09:35:55 +02:00
parent bc1ad37ade
commit 4da0be4806
6 changed files with 19 additions and 0 deletions

View File

@ -261,4 +261,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
</xsl:call-template>
</xsl:template>
<xsl:template match="para_toc_note">
<xsl:text>\addtocontents{toc}{</xsl:text><xsl:apply-templates select="@*|node()"/><xsl:text>}</xsl:text>
</xsl:template>
</xsl:stylesheet>

View File

@ -63,6 +63,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<xsl:apply-templates/>
</xsl:element>
</xsl:when>
<xsl:when test="@role='note_table_des_matieres'">
<xsl:element name="para_toc_note">
<xsl:apply-templates/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="para">
<xsl:apply-templates select="@*|node()"/>

View File

@ -311,6 +311,9 @@ def handle_paragraph(parent, elem):
para = ET.SubElement(parent, 'para')
if style == 'Larttitre':
para.attrib['role'] = 'legistic_manualarticle'
if style == 'NoteTableDesMatieres':
para.attrib['role'] = 'note_table_des_matieres'
fill_inline(para, elem, invert_bg=invert_bg)
if not (para.text or para.tail or len(para.getchildren())):
if para in parent:

View File

@ -14,6 +14,7 @@ legi_styles = [('Titre Préface', 'TitrePreface'),
('Ss-Titre', 'Sous-Titre'),
('Literal', 'Standard'),
('Note', 'Note'),
('NoteTdM', 'NoteTableDesMatieres'),
('Para', 'Text body')
]

View File

@ -166,6 +166,9 @@
<style:style style:name="Note" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
<style:text-properties fo:font-style="italic"/>
</style:style>
<style:style style:name="NoteTableDesMatieres" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
<style:text-properties fo:font-style="italic"/>
</style:style>
<style:style style:name="Signature" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
</style:style>
<style:style style:name="LegisticNumberPart" style:parent-style-name="Numbering_20_Symbols">

View File

@ -163,6 +163,9 @@
<style:style style:name="Note" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
<style:text-properties fo:font-style="italic"/>
</style:style>
<style:style style:name="NoteTableDesMatieres" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
<style:text-properties fo:font-style="italic"/>
</style:style>
<style:style style:name="Signature" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
</style:style>
<style:style style:name="LegisticNumberPart" style:parent-style-name="Numbering_20_Symbols">