Skip to content
This repository has been archived by the owner on Nov 18, 2023. It is now read-only.

Commit

Permalink
allow for index
Browse files Browse the repository at this point in the history
  • Loading branch information
miekg committed Jul 7, 2014
1 parent a6b952d commit 881a60a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -27,6 +27,10 @@ Although you can type Pandoc just fine, there are two things that differ

* An index is done by (yet again) by using a foonote, but the first item is a subscript:

^[ ^list^ format styles]

The rest of the content is the "subitem"

As said, more extensive docs are here:
<http://tools.ietf.org/html/draft-gieben-pandoc2rfc-03>. But after some setup, it
is *just* typing Pandoc syntax in $EDITOR.
Expand Down
4 changes: 4 additions & 0 deletions test/back.mkd
Expand Up @@ -78,6 +78,10 @@ Use `style="format REQ%d."`, by using the following strikethrough syntax:
1. ~~REQ%d.~~ This is the firs item;
2. Should be type set as REQ2.

This will be generating an index

^[ ^list^ format styles]

More

1. First we do
Expand Down
20 changes: 19 additions & 1 deletion transform.xsl
Expand Up @@ -12,7 +12,25 @@
</xsl:template>
<!-- Remove the article info section, this should be handled in the <front> matter of the draft -->
<xsl:template match="articleinfo"/>
<xsl:template match="footnote"/>
<xsl:template match="footnote">
<xsl:choose>
<xsl:when test="child::para/superscript">
<iref>
<xsl:attribute name="item">
<xsl:value-of select="para/superscript"/>
</xsl:attribute>
<xsl:attribute name="subitem">
<xsl:for-each select="./para/text()[not(ancestor::superscript)]">
<xsl:value-of select="normalize-space(translate(., '&#10;', ' '))"/>
</xsl:for-each>
</xsl:attribute>
</iref>
</xsl:when>
<xsl:otherwise>
<!-- discard -->
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Merge section with the title tags into one section -->
<xsl:template match="section | simplesect | sect1 | sect2 | sect3 | sect4 | sect5">
<section>
Expand Down

0 comments on commit 881a60a

Please sign in to comment.