Skip to content

Commit

Permalink
add section nesting to mkv elements
Browse files Browse the repository at this point in the history
  • Loading branch information
dericed committed Jul 25, 2018
1 parent 5b7afab commit e0b6a68
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $(OUTPUT_TAGS).md: index_tags.md tagging.md matroska_tagging_registry.md tagging
cat $^ > $@

%.xml: %.md
mmark -xml2 -page $< > $@
mmark -xml2 -page $< | awk '/<?rfc toc=/ && !modif { printf("<?rfc tocdepth=\"12\"?>\n"); modif=1 } {print}' > $@

%.html: %.xml
xml2rfc --html $< -o $@
Expand Down
14 changes: 11 additions & 3 deletions transforms/ebml_schema2markdown4rfc.xsl
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="UTF-8" method="text" version="1.0" indent="yes"/>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:str="http://exslt.org/strings">
<xsl:output encoding="UTF-8" method="text" version="1.0" indent="yes" />
<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:template match="EBMLSchema">
<xsl:apply-templates select="//element"/>
</xsl:template>
<xsl:template match="element">
<xsl:text>### </xsl:text>
<xsl:choose>
<xsl:when test="contains(@path,'\EBML\')">
<xsl:text>###</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring('############################',1,count(str:tokenize(@path,'\'))+1)"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text> </xsl:text>
<xsl:value-of select="@name"/>
<xsl:text> Element&#xa;&#xa;</xsl:text>
<xsl:if test="@name">
Expand Down

0 comments on commit e0b6a68

Please sign in to comment.