add a new "note for toc" style, that adds text to the table of contents (#390)
This commit is contained in:
parent
bc1ad37ade
commit
4da0be4806
|
@ -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>
|
||||
|
|
|
@ -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()"/>
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -14,6 +14,7 @@ legi_styles = [('Titre Préface', 'TitrePreface'),
|
|||
('Ss-Titre', 'Sous-Titre'),
|
||||
('Literal', 'Standard'),
|
||||
('Note', 'Note'),
|
||||
('NoteTdM', 'NoteTableDesMatieres'),
|
||||
('Para', 'Text body')
|
||||
]
|
||||
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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">
|
||||
|
|
Reference in New Issue