summaryrefslogtreecommitdiff
path: root/swext/mediawiki/src/filter/odt2mediawiki.xsl
diff options
context:
space:
mode:
authorRobert Antoni Buj Gelonch <robert.buj@gmail.com>2015-05-18 14:15:28 +0200
committerDavid Tardon <dtardon@redhat.com>2015-05-18 17:26:19 +0000
commitb532d46551489e84d2754c815f5076f47f824117 (patch)
tree1434a096babc5787f86d310e9fde80ca2ce659f3 /swext/mediawiki/src/filter/odt2mediawiki.xsl
parentec916dc7bc8ee37e27c9c12e08e9235de6d2278c (diff)
odt2mediawiki.xsl: tabulation in toc entries
Change-Id: I596bd1c8814efcf2070d3e6d2ff126c03c0ec168 Reviewed-on: https://gerrit.libreoffice.org/15785 Tested-by: David Tardon <dtardon@redhat.com> Reviewed-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'swext/mediawiki/src/filter/odt2mediawiki.xsl')
-rw-r--r--swext/mediawiki/src/filter/odt2mediawiki.xsl31
1 files changed, 31 insertions, 0 deletions
diff --git a/swext/mediawiki/src/filter/odt2mediawiki.xsl b/swext/mediawiki/src/filter/odt2mediawiki.xsl
index d8a9fba40d90..f0a9f121b602 100644
--- a/swext/mediawiki/src/filter/odt2mediawiki.xsl
+++ b/swext/mediawiki/src/filter/odt2mediawiki.xsl
@@ -174,6 +174,12 @@
/>
<key
+ name="text:table-of-content-entry-ref"
+ match="//text:table-of-content-entry-template"
+ use="@text:style-name"
+ />
+
+ <key
name="reference-resolution"
match="//text:reference-mark | //text:reference-mark-start"
use="@text:name"
@@ -699,6 +705,21 @@
</choose>
</template>
+ <!--
+ Function for generating tabulations in TOC entries.
+
+ @param style
+ The style of the TOC entry
+ -->
+ <template name="mk-tab-toc">
+ <param name="style"/>
+ <if test="number($style/@text:outline-level) &gt; 0">
+ <call-template name="mk-token">
+ <with-param name="level" select="number($style/@text:outline-level) - 1"/>
+ <with-param name="char" select="':'"/>
+ </call-template>
+ </if>
+ </template>
<!--
== WikiLink ==
@@ -726,6 +747,16 @@
-->
<template match="text:p">
+ <!-- TOC tabs -->
+ <if test="ancestor::text:index-body and boolean(@text:style-name)">
+ <variable name="style" select="key('style-ref', @text:style-name)"/>
+ <if test="boolean($style/@style:parent-style-name)">
+ <call-template name="mk-tab-toc">
+ <with-param name="style" select="key('text:table-of-content-entry-ref', $style/@style:parent-style-name)"/>
+ </call-template>
+ </if>
+ </if>
+
<variable name="alignment">
<call-template name="mk-style-set">
<with-param name="node" select="."/>