This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
md-pdf/md_pdf/assets/templates/toc-template.xsl

48 lines
1.4 KiB
XML
Raw Normal View History

2017-05-17 17:52:57 +01:00
<?xml version="1.0" encoding="UTF-8"?>
2017-05-17 18:04:45 +01:00
<xsl:stylesheet
version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:outline="http://wkhtmltopdf.org/outline"
xmlns="http://www.w3.org/1999/xhtml">
2017-05-17 17:52:57 +01:00
<xsl:template match="outline:outline">
<html>
<head>
<link rel="stylesheet" href="{{ static_dir }}/style.css" />
</head>
2017-05-17 19:58:29 +01:00
<body class="tocs">
2017-05-17 17:52:57 +01:00
<h1>Table of Contents</h1>
2017-05-17 18:04:45 +01:00
<ul>
<xsl:apply-templates select="outline:item/outline:item"/>
</ul>
2017-05-17 17:52:57 +01:00
</body>
</html>
</xsl:template>
<xsl:template match="outline:item">
<li>
2017-05-23 21:59:40 +01:00
<xsl:if test="@page!='2' and @title!='References'">
2017-05-17 19:58:29 +01:00
<div class="row">
<a class="title">
2017-05-17 17:52:57 +01:00
<xsl:if test="@link">
2017-05-17 18:04:45 +01:00
<xsl:attribute name="href">
<xsl:value-of select="@link"/>
</xsl:attribute>
2017-05-17 17:52:57 +01:00
</xsl:if>
<xsl:if test="@backLink">
2017-05-17 18:04:45 +01:00
<xsl:attribute name="name">
<xsl:value-of select="@backLink"/>
</xsl:attribute>
2017-05-17 17:52:57 +01:00
</xsl:if>
<xsl:value-of select="@title" />
</a>
2017-05-17 19:58:29 +01:00
<span class="page-number">
2017-05-17 18:04:45 +01:00
<xsl:value-of select="@page" />
</span>
2017-05-17 17:52:57 +01:00
</div>
</xsl:if>
<ul>
<xsl:apply-templates select="outline:item"/>
</ul>
</li>
</xsl:template>
</xsl:stylesheet>