Skip to content

Commit

Permalink
Merge pull request #250 from Matroska-Org/add-sections-to-mkv-elements
Browse files Browse the repository at this point in the history
Add sections to mkv elements
  • Loading branch information
dericed authored Jul 26, 2018
2 parents f59fd16 + 59554fc commit 75dd84b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 179 deletions.
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,22 @@ $(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=\"6\"?>\n"); modif=1 } {print}' > $@

%.html: %.xml
xml2rfc --html $< -o $@

%.txt: %.xml
xml2rfc $< -o $@

ebml_matroska_elements.md: ebml_matroska.xml transforms/ebml_schema2markdown.xsl
xsltproc transforms/ebml_schema2markdown.xsl $< > $@

matroska_tagging_registry.md: matroska_tags.xml transforms/matroska_tags2markdown4rfc.xsl
xsltproc transforms/matroska_tags2markdown4rfc.xsl $< > $@

website:
jekyll b

clean:
$(RM) -f $(OUTPUT_MATROSKA).txt $(OUTPUT_MATROSKA).html $(OUTPUT_MATROSKA).md $(OUTPUT_MATROSKA).xml ebml_matroska_elements.md ebml_matroska_elements4rfc.md matroska_tagging_registry.md
$(RM) -f $(OUTPUT_MATROSKA).txt $(OUTPUT_MATROSKA).html $(OUTPUT_MATROSKA).md $(OUTPUT_MATROSKA).xml ebml_matroska_elements4rfc.md matroska_tagging_registry.md
$(RM) -f $(OUTPUT_CODEC).txt $(OUTPUT_CODEC).html $(OUTPUT_CODEC).md $(OUTPUT_CODEC).xml
$(RM) -f $(OUTPUT_TAGS).txt $(OUTPUT_TAGS).html $(OUTPUT_TAGS).md $(OUTPUT_TAGS).xml
$(RM) -rf _site
11 changes: 4 additions & 7 deletions matroska_schema_section_header.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@

# Matroska Schema

This specification includes an `EBML Schema` which defines the Elements and structure of Matroska as an EBML Document Type. The EBML Schema defines every valid Matroska element in a manner defined by the EBML specification.

## Matroska Additions to Schema Element Attributes
# Matroska Additions to Schema Element Attributes

In addition to the EBML Schema definition provided by the EBML Specification, Matroska adds the following additional attributes:

| attribute name | required | definition |
|:---------------|:---------|:-----------|
| webm | No | A boolean to express if the Matroska Element is also supported within version 2 of the `webm` specification. Please consider the [webm specification](http://www.webmproject.org/docs/container/) as the authoritative on `webm`. |

## Matroska Schema Element Definitions
# Matroska Schema

This specification includes an `EBML Schema` which defines the Elements and structure of Matroska as an EBML Document Type. The EBML Schema defines every valid Matroska element in a manner defined by the EBML specification.

Here the definition of each Matroska Element is provided.

% concatenate with Matroska EBML Schema converted to markdown %
164 changes: 0 additions & 164 deletions transforms/ebml_schema2markdown.xsl

This file was deleted.

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,'\')))"/>
</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 75dd84b

Please sign in to comment.