-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.xsl
30 lines (27 loc) · 924 Bytes
/
index.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:output encoding="UTF-8" method="text" />
<xsl:template match="/book">
<xsl:text># </xsl:text>
<xsl:value-of select="title" /><xsl:text>
## Index
</xsl:text>
<xsl:for-each select="chapter">
<xsl:text>* [</xsl:text>
<xsl:value-of select="title" />
<xsl:text>](chapter_</xsl:text>
<xsl:number/>
<xsl:text>.md)
</xsl:text>
</xsl:for-each>
<xsl:for-each select="appendix">
<xsl:text>* Appendix [</xsl:text>
<xsl:value-of select="title" />
<xsl:text>](appendix_</xsl:text>
<xsl:number/>
<xsl:text>.md)
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>