diff --git a/.gitignore b/.gitignore index 71722405..65ab7d93 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ ebml_matroska_elements.md ebml_matroska_elements4rfc.md matroska_tagging_registry.md matroska_xsd.xml +metadata.min.js diff --git a/Makefile b/Makefile index 94fb3845..21188db3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -$(info RFC rendering has been tested with mmark version 1.3.4 and xml2rfc 2.5.1, please ensure these are installed and recent enough.) +$(info RFC rendering has been tested with mmark version 2.1.1 and xml2rfc 2.30.0, please ensure these are installed and recent enough.) VERSION_MATROSKA := 04 VERSION_CODEC := 03 @@ -10,6 +10,14 @@ OUTPUT_MATROSKA := $(STATUS_MATROSKA)ietf-cellar-matroska-$(VERSION_MATROSKA) OUTPUT_CODEC := $(STATUS_CODEC)ietf-cellar-codecs-$(VERSION_CODEC) OUTPUT_TAGS := $(STATUS_TAGS)ietf-cellar-tags-$(VERSION_TAGS) +XML2RFC_CALL := xml2rfc +MMARK_CALL := mmark + +-include runtimes.mak + +XML2RFC := $(XML2RFC_CALL) --v3 +MMARK := $(MMARK_CALL) + all: $(OUTPUT_MATROSKA).html $(OUTPUT_MATROSKA).txt $(OUTPUT_MATROSKA).xml $(OUTPUT_CODEC).html $(OUTPUT_CODEC).txt $(OUTPUT_CODEC).xml $(OUTPUT_TAGS).html $(OUTPUT_TAGS).txt $(OUTPUT_TAGS).xml matroska_xsd.xml: transforms/schema_clean.xsl ebml_matroska.xml @@ -21,23 +29,23 @@ check: matroska_xsd.xml ebml_matroska_elements4rfc.md: transforms/ebml_schema2markdown4rfc.xsl matroska_xsd.xml xsltproc transforms/ebml_schema2markdown4rfc.xsl matroska_xsd.xml > $@ -$(OUTPUT_MATROSKA).md: index_matroska.md diagram.md matroska_schema_section_header.md ebml_matroska_elements4rfc.md ordering.md chapters.md attachments.md cues.md streaming.md menu.md notes.md +$(OUTPUT_MATROSKA).md: index_matroska.md diagram.md matroska_schema_section_header.md ebml_matroska_elements4rfc.md ordering.md chapters.md attachments.md cues.md streaming.md menu.md notes.md rfc_backmatter_matroska.md cat $^ | grep -v '^---' > $@ -$(OUTPUT_CODEC).md: index_codec.md codec_specs.md subtitles.md block_additional_mappings_intro.md block_additional_mappings/*.md +$(OUTPUT_CODEC).md: index_codec.md codec_specs.md subtitles.md block_additional_mappings_intro.md rfc_backmatter_codec.md cat $^ > $@ -$(OUTPUT_TAGS).md: index_tags.md tagging.md matroska_tagging_registry.md tagging_end.md +$(OUTPUT_TAGS).md: index_tags.md tagging.md matroska_tagging_registry.md tagging_end.md rfc_backmatter_tags.md cat $^ > $@ %.xml: %.md - mmark -xml2 -page $< | awk '/\n"); modif=1 } {print}' > $@ + $(MMARK) $< | awk '/\n"); modif=1 } {print}' > $@ %.html: %.xml - xml2rfc --html $< -o $@ + $(XML2RFC) --html $< -o $@ %.txt: %.xml - xml2rfc $< -o $@ + $(XML2RFC) $< -o $@ matroska_tagging_registry.md: matroska_tags.xml transforms/matroska_tags2markdown4rfc.xsl xsltproc transforms/matroska_tags2markdown4rfc.xsl $< > $@ diff --git a/README.md b/README.md index 2008f9d3..b6ba8a2f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This repository holds content related to the official Matroska specification and ## About this repository -Local versions of the specification can be generated based on code in the `Makefile` directory and related dependencies. The dependencies required are `mmark`, `xml2rfc` and `xsltproc`. `mmark` is a Markdown processor written in Go, available [here](https://github.com/miekg/mmark) or, for Homebrew users, can be installed with `brew install mmark`. Installation instructions for `xml2rfc` (an XML-to-IETF-draft translator written in Python) are available on the [IETF Tools page](https://tools.ietf.org/tools/). `xsltproc` is a command line tool for applying XSLT stylesheets to XML documents. +Local versions of the specification can be generated based on code in the `Makefile` directory and related dependencies. The dependencies required are `mmark`, `xml2rfc` and `xsltproc`. `mmark` is a Markdown processor written in Go, available [here](https://github.com/mmarkdown/mmark) . Installation instructions for `xml2rfc` (an XML-to-IETF-draft translator written in Python) are available on the [IETF Tools page](https://tools.ietf.org/tools/). `xsltproc` is a command line tool for applying XSLT stylesheets to XML documents. A bootstrap and Makefile are provided to gather dependencies and generate the RFC documents. To create local copies of the RFC in `.txt`, `.md`, and `.html` format, run `make`. diff --git a/bootstrap b/bootstrap new file mode 100755 index 00000000..6145fddd --- /dev/null +++ b/bootstrap @@ -0,0 +1,128 @@ +#!/bin/sh +# +# bootstrap script to get the tools needed to build the specs within a UNIX shell + +export LC_ALL= +FOUND= +NEEDED= + +BOOTSTRAP_MAKE=bootstrap.mak +RUNTIMES_MAKE=runtimes.mak + +check_version() { + gotver=$2 + gotmajor=`echo $gotver|cut -d. -f1` + gotminor=`echo $gotver|cut -d. -f2|cut -d+ -f1` + gotmicro=`echo $gotver|cut -d. -f3|cut -d+ -f1` + [ -z "$gotmicro" ] && gotmicro=0 + needmajor=`echo $3|cut -d. -f1` + needminor=`echo $3|cut -d. -f2` + needmicro=`echo $3|cut -d. -f3` + [ -z "$needmicro" ] && needmicro=0 + if [ "$needmajor" -ne "$gotmajor" \ + -o "$needmajor" -eq "$gotmajor" -a "$needminor" -gt "$gotminor" \ + -o "$needmajor" -eq "$gotmajor" -a "$needminor" -eq "$gotminor" -a "$needmicro" -gt "$gotmicro" ] + then + echo "$1 too old (got $gotver, needed $3)" + NEEDED="$NEEDED $1" + else + FOUND="$FOUND $1" + echo "found $1 version $2 (needed $3)" + fi +} + +check() { + if ! $1 --version >/dev/null 2>&1 && ! $1 -version >/dev/null 2>&1 + then + echo "$1 not found" + NEEDED="$NEEDED $1" + else + # found, need to check version ? + if [ -z "$2" ];then + FOUND="$FOUND $1" + echo "found $1" + else + gotver=`$1 --version | head -1 | sed s/'.* '//` + check_version $1 $gotver $2 + fi + fi +} + +# check make +check mmark 2.1.1 +check xml2rfc 2.30.0 +# apt install xsltproc +check xsltproc 1.1.0 +# apt install libxml2-utils +check xmllint 20903 + +cat > $BOOTSTRAP_MAKE << EOF +PREFIX=\$(abspath ./build) +EOF + +echo "# calls the local or installed tool " > $RUNTIMES_MAKE + +for t in $FOUND; do + echo ".$t:" >> $BOOTSTRAP_MAKE + echo "$t" | awk '{ tool = sprintf("%s_CALL := %s", toupper($0), $0); print tool }' >> $RUNTIMES_MAKE +done + +for t in $NEEDED; do + echo .$t: .build$t >> $BOOTSTRAP_MAKE + PACKAGES="$PACKAGES $t" + TARGETS="$TARGETS .build$t" + if [ $t = "xml2rfc" ]; then + # installed in the Python local user dir + PYTHON_USER_PATH=$(python -m site --user-base) + echo PYTHON_USER_PATH=$PYTHON_USER_PATH >> $RUNTIMES_MAKE + echo "$t" | awk '{ tool = sprintf("%s_CALL := $(PYTHON_USER_PATH)/bin/%s", toupper($0), $0); print tool }' >> $RUNTIMES_MAKE + else + echo "$t" | awk '{ tool = sprintf("%s_CALL := ./%s", toupper($0), $0); print tool }' >> $RUNTIMES_MAKE + fi +done + +[ -n "$PACKAGES" ] && echo "To-be-built packages: $PACKAGES" + +case `uname` in + Linux) + MMARK_OS=linux + ;; + Darwin) + MMARK_OS=darwin + ;; + MINGW32*|MINGW64*|*MSYS*) + MMARK_OS=windows + ;; + *) + echo Unsupported build OS `uname` + exit 1 + ;; +esac +case `uname -m` in + x86_64) + MMARK_MACHINE=amd64 + ;; + arm64) + MMARK_MACHINE=arm64 + ;; + arm) + MMARK_MACHINE=arm + ;; + *) + echo Unsupported build CPU `uname -m` + exit 1 + ;; +esac + +cat >> $BOOTSTRAP_MAKE << EOF +all: $TARGETS + @echo "You are ready to build Matroska specifications" + +MMARK_VERSION=2.1.1 +MMARK_OS=$MMARK_OS +MMARK_MACHINE=$MMARK_MACHINE + +include tools.mak +EOF + +make -f $BOOTSTRAP_MAKE \ No newline at end of file diff --git a/chapters.md b/chapters.md index 0fe8edf3..899e8910 100644 --- a/chapters.md +++ b/chapters.md @@ -66,7 +66,7 @@ These other `Elements` belong to the Matroska DVD menu system and are only used - Soft Linking: In this complex system `Ordered Chapters` are REQUIRED and a `Chapter CODEC` MUST interpret the `ChapProcess` of all chapters. - Medium Linking: `Ordered Chapters` are used in a normal way and can be combined with the `ChapterSegmentUID` element which establishes a link to another Matroska file/Segment. -See [the section on the `Linked Segments`](#linked-segments)) for more information about `Hard Linking`, `Soft Linking` and `Medium Linking`. +See [the section on the Linked Segments](#linked-segments)) for more information about `Hard Linking`, `Soft Linking` and `Medium Linking`. ## Menu features diff --git a/codec/av1.md b/codec/av1.md index 0c54ab91..6d6642b9 100644 --- a/codec/av1.md +++ b/codec/av1.md @@ -172,7 +172,7 @@ Within a protected `Block`, the following constraints apply to all the OBUs it c * Encrypted partitions MUST span all complete 16-byte blocks of the __[decode_tile]__ structure (including any trailing bits). - * Bytes at the beginning of the __[decode_tile]__ that do not fit in the 16-bytes encrypted partitions SHOULD be added to the preceding unprotected partition. As a result the Encrypted partitions MAY NOT start at the first byte of the __[decode_tile]__ structure, but some number of bytes following that. + * Bytes at the beginning of the __[decode_tile]__ that do not fit in the 16-bytes encrypted partitions SHOULD be added to the preceding unprotected partition. As a result the Encrypted partitions might not start at the first byte of the __[decode_tile]__ structure, but some number of bytes following that. # More TrackEntry mappings @@ -217,7 +217,7 @@ The `BitsPerChannel` corresponds to the __[BitDepth]__. ### MatrixCoefficients EBML Path: `\Segment\Tracks\TrackEntry\Video\Colour\MatrixCoefficients` | Mandatory: No -The `MatrixCoefficients` corresponds to the __[matrix_coefficients]__. Some values MAY NOT map correctly to values found in Matroska. +The `MatrixCoefficients` corresponds to the __[matrix_coefficients]__. Some values might not map correctly to values found in Matroska. ### ChromaSitingHorz EBML Path: `\Segment\Tracks\TrackEntry\Video\Colour\ChromaSitingHorz` | Mandatory: No @@ -245,7 +245,7 @@ The `TransferCharacteristics` corresponds to the __[transfer_characteristics]__. ### Primaries EBML Path: `\Segment\Tracks\TrackEntry\Video\Colour\Primaries` | Mandatory: No -The `Primaries` corresponds to the __[color_primaries]__. Some values MAY NOT map correctly to values found in Matroska. +The `Primaries` corresponds to the __[color_primaries]__. Some values might not map correctly to values found in Matroska. ## Metadata OBU-based values diff --git a/codec_specs.md b/codec_specs.md index fb016f17..80beed43 100644 --- a/codec_specs.md +++ b/codec_specs.md @@ -66,7 +66,9 @@ The following XML depicts the nested Elements of a `BlockGroup Element` with an 1 - {alpha channel encoding to supplement the VP9 frame} + + {alpha channel encoding to supplement the VP9 frame} + @@ -667,7 +669,7 @@ Codec ID: S_TEXT/UTF8 Codec Name: UTF-8 Plain Text -Description: Basic text subtitles. For more information, please look at [the `Subtitles` section](#subtitles). +Description: Basic text subtitles. For more information, please look at [the Subtitles section](#subtitles). ### S_TEXT/SSA @@ -675,7 +677,7 @@ Codec ID: S_TEXT/SSA Codec Name: Subtitles Format -Description: The [Script Info] and [V4 Styles] sections are stored in the codecprivate. Each event is stored in its own Block. For more information, see [the SSA/ASS section in `Subtitles`](#subtitles). +Description: The [Script Info] and [V4 Styles] sections are stored in the codecprivate. Each event is stored in its own Block. For more information, see [the SSA/ASS section in Subtitles](#subtitles). ### S_TEXT/ASS @@ -683,7 +685,7 @@ Codec ID: S_TEXT/ASS Codec Name: Advanced Subtitles Format -Description: The [Script Info] and [V4 Styles] sections are stored in the codecprivate. Each event is stored in its own Block. For more information, see [the SSA/ASS section in `Subtitles`](#subtitles). +Description: The [Script Info] and [V4 Styles] sections are stored in the codecprivate. Each event is stored in its own Block. For more information, see [the SSA/ASS section in Subtitles](#subtitles). ### S_TEXT/USF @@ -691,7 +693,7 @@ Codec ID: S_TEXT/USF Codec Name: Universal Subtitle Format -Description: This is mostly defined, but not typed out yet. It will first be available on the USF specification [in `Subtitles`](#subtitles). +Description: This is mostly defined, but not typed out yet. It will first be available on the USF specification [in Subtitles](#subtitles). ### S_TEXT/WEBVTT @@ -699,7 +701,7 @@ Codec ID: S_TEXT/WEBVTT Codec Name: Web Video Text Tracks Format (WebVTT) -Description: Advanced text subtitles. For more information, see [the WebVTT section in `Subtitles`](#subtitles). +Description: Advanced text subtitles. For more information, see [the WebVTT section in Subtitles](#subtitles). ### S_IMAGE/BMP @@ -715,7 +717,7 @@ Codec ID: S_DVBSUB Codec Name: Digital Video Broadcasting (DVB) subtitles -Description: This is the graphical subtitle format used in the Digital Video Broadcasting standard. For more information, see [the Digital Video Broadcasting (DVB) section in `Subtitles`](#subtitles). +Description: This is the graphical subtitle format used in the Digital Video Broadcasting standard. For more information, see [the Digital Video Broadcasting (DVB) section in Subtitles](#subtitles). ### S_VOBSUB @@ -733,7 +735,7 @@ Codec ID: S_HDMV/PGS Codec Name: HDMV presentation graphics subtitles (PGS) -Description: This is the graphical subtitle format used on Blu-rays. For more information, see [HDMV text presentation in `Subtitles`](#subtitles). +Description: This is the graphical subtitle format used on Blu-rays. For more information, see [HDMV text presentation in Subtitles](#subtitles). ### S_HDMV/TEXTST @@ -741,7 +743,7 @@ Codec ID: S_HDMV/TEXTST Codec Name: HDMV text subtitles -Description: This is the textual subtitle format used on Blu-rays. For more information, see [HDMV graphics presentation in `Subtitles`](#subtitles). +Description: This is the textual subtitle format used on Blu-rays. For more information, see [HDMV graphics presentation in Subtitles](#subtitles). ### S_KATE diff --git a/diagram.md b/diagram.md index 4add8e4e..4a6cef47 100644 --- a/diagram.md +++ b/diagram.md @@ -152,21 +152,21 @@ The `Chapters Element` lists all of the chapters. Chapters are a way to set pred | | | EditionFlagDefault | | | |--------------------| | | | EditionFlagOrdered | -| | |--------------------------------+ -| | | ChapterAtom | ChapterUID | -| | | |------------------| -| | | | ChapterStringUID | -| | | |------------------| -| | | | ChapterTimeStart | -| | | |------------------| -| | | | ChapterTimeEnd | -| | | |------------------| +| | |---------------------------------+ +| | | ChapterAtom | ChapterUID | +| | | |-------------------| +| | | | ChapterStringUID | +| | | |-------------------| +| | | | ChapterTimeStart | +| | | |-------------------| +| | | | ChapterTimeEnd | +| | | |-------------------| | | | | ChapterFlagHidden | -| | | |---------------------------------+ -| | | | ChapterDisplay | ChapString | -| | | | |--------------| -| | | | | ChapLanguage | -+--------------------------------------------------------------------+ +| | | |-------------------------------+ +| | | | ChapterDisplay | ChapString | +| | | | |--------------| +| | | | | ChapLanguage | ++------------------------------------------------------------------+ ``` Figure: Representation of the `Chapters Element` and a selection of its `Descendant Elements`. @@ -210,7 +210,7 @@ Figure: Representation of a `Cluster Element` and its immediate `Child Elements` | | Data | Frame | +----------------------------------+ ``` -Figure: Representation of the `Block Element` structure. +Figure: Representation of the `Block Element` structure. Each `Cluster` MUST contain exactly one `Timestamp Element`. The `Timestamp Element` value MUST be stored once per `Cluster`. The `Timestamp Element` in the `Cluster` is relative to the entire `Segment`. The `Timestamp Element` SHOULD be the first `Element` in the `Cluster`. diff --git a/index_codec.md b/index_codec.md index 57288144..921ac348 100644 --- a/index_codec.md +++ b/index_codec.md @@ -1,35 +1,38 @@ ---- ---- - -% Title = "Matroska Codec" -% abbrev = "Matroska" -% category = "std" -% docName = "draft-ietf-cellar-codec-02" -% ipr= "trust200902" -% area = "art" -% workgroup = "cellar" -% keyword = [""] -% -% [[author]] -% initials="S." -% surname="Lhomme" -% fullname="Steve Lhomme" -% [author.address] -% email="slhomme@matroska.org" -% -% [[author]] -% initials="M." -% surname="Bunkus" -% fullname="Moritz Bunkus" -% [author.address] -% email="moritz@bunkus.org" -% -% [[author]] -% initials="D." -% surname="Rice" -% fullname="Dave Rice" -% [author.address] -% email="dave@dericed.com" +%%% +title = "Matroska Codec" +abbrev = "Matroska" +ipr= "trust200902" +area = "art" +workgroup = "cellar" +keyword = [""] + +[seriesInfo] +name = "Internet Draft" +stream = "IETF" +status = "informational" +value = "draft-ietf-cellar-codecs-03" + +[[author]] +initials="S." +surname="Lhomme" +fullname="Steve Lhomme" + [author.address] + email="slhomme@matroska.org" + +[[author]] +initials="M." +surname="Bunkus" +fullname="Moritz Bunkus" + [author.address] + email="moritz@bunkus.org" + +[[author]] +initials="D." +surname="Rice" +fullname="Dave Rice" + [author.address] + email="dave@dericed.com" +%%% .# Abstract @@ -57,5 +60,5 @@ To be determined. # Notations and Conventions -The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119). +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [@!RFC2119] [@!RFC8174] when, and only when, they appear in all capitals, as shown here. diff --git a/index_matroska.md b/index_matroska.md index c8668b4f..204903c8 100644 --- a/index_matroska.md +++ b/index_matroska.md @@ -1,35 +1,38 @@ ---- ---- - -% Title = "Matroska Specifications" -% abbrev = "Matroska" -% category = "std" -% docName = "draft-ietf-cellar-matroska-03" -% ipr= "trust200902" -% area = "art" -% workgroup = "cellar" -% keyword = [""] -% -% [[author]] -% initials="S." -% surname="Lhomme" -% fullname="Steve Lhomme" -% [author.address] -% email="slhomme@matroska.org" -% -% [[author]] -% initials="M." -% surname="Bunkus" -% fullname="Moritz Bunkus" -% [author.address] -% email="moritz@bunkus.org" -% -% [[author]] -% initials="D." -% surname="Rice" -% fullname="Dave Rice" -% [author.address] -% email="dave@dericed.com" +%%% +title = "Matroska Specifications" +abbrev = "Matroska" +ipr= "trust200902" +area = "art" +workgroup = "cellar" +keyword = [""] + +[seriesInfo] +name = "Internet-Draft" +stream = "IETF" +status = "informational" +value = "draft-ietf-cellar-matroska-04" + +[[author]] +initials="S." +surname="Lhomme" +fullname="Steve Lhomme" + [author.address] + email="slhomme@matroska.org" + +[[author]] +initials="M." +surname="Bunkus" +fullname="Moritz Bunkus" + [author.address] + email="moritz@bunkus.org" + +[[author]] +initials="D." +surname="Rice" +fullname="Dave Rice" + [author.address] + email="dave@dericed.com" +%%% .# Abstract @@ -86,7 +89,7 @@ To be determined. # Notation and Conventions -The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119). +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [@!RFC2119] [@!RFC8174] when, and only when, they appear in all capitals, as shown here. This document defines specific terms in order to define the format and application of `Matroska`. Specific terms are defined below: @@ -139,7 +142,7 @@ Each level can have different meanings for audio and video. The ORIGINAL_MEDIUM Bit 0 is the most significant bit. -Frames using references SHOULD be stored in "coding order". That means the references first and then the frames referencing them. A consequence is that timestamps MAY NOT be consecutive. But a frame with a past timestamp MUST reference a frame already known, otherwise it's considered bad/void. +Frames using references SHOULD be stored in "coding order". That means the references first and then the frames referencing them. A consequence is that timestamps might not be consecutive. But a frame with a past timestamp MUST reference a frame already known, otherwise it's considered bad/void. There can be many Blocks in a BlockGroup provided they all have the same timestamp. It is used with different parts of a frame with different priorities. @@ -222,7 +225,7 @@ The `SimpleBlock` is inspired by the [Block structure](#block-structure). The ma Bit 0 is the most significant bit. -Frames using references SHOULD be stored in "coding order". That means the references first and then the frames referencing them. A consequence is that timestamps MAY NOT be consecutive. But a frame with a past timestamp MUST reference a frame already known, otherwise it's considered bad/void. +Frames using references SHOULD be stored in "coding order". That means the references first and then the frames referencing them. A consequence is that timestamps might not be consecutive. But a frame with a past timestamp MUST reference a frame already known, otherwise it's considered bad/void. There can be many `Block Elements` in a `BlockGroup` provided they all have the same timestamp. It is used with different parts of a frame with different priorities. diff --git a/index_tags.md b/index_tags.md index 10437288..a0a2c6e6 100644 --- a/index_tags.md +++ b/index_tags.md @@ -1,35 +1,38 @@ ---- ---- - -% Title = "Matroska Tags" -% abbrev = "Matroska" -% category = "std" -% docName = "draft-ietf-cellar-tags-02" -% ipr= "trust200902" -% area = "art" -% workgroup = "cellar" -% keyword = [""] -% -% [[author]] -% initials="S." -% surname="Lhomme" -% fullname="Steve Lhomme" -% [author.address] -% email="slhomme@matroska.org" -% -% [[author]] -% initials="M." -% surname="Bunkus" -% fullname="Moritz Bunkus" -% [author.address] -% email="moritz@bunkus.org" -% -% [[author]] -% initials="D." -% surname="Rice" -% fullname="Dave Rice" -% [author.address] -% email="dave@dericed.com" +%%% +title = "Matroska Tags" +abbrev = "Matroska" +ipr= "trust200902" +area = "art" +workgroup = "cellar" +keyword = [""] + +[seriesInfo] +name = "Internet-Draft" +stream = "IETF" +status = "informational" +value = "draft-ietf-cellar-tags-03" + +[[author]] +initials="S." +surname="Lhomme" +fullname="Steve Lhomme" +[author.address] + email="slhomme@matroska.org" + +[[author]] +initials="M." +surname="Bunkus" +fullname="Moritz Bunkus" + [author.address] + email="moritz@bunkus.org" + +[[author]] +initials="D." +surname="Rice" +fullname="Dave Rice" + [author.address] + email="dave@dericed.com" +%%% .# Abstract @@ -57,5 +60,5 @@ To be determined. # Notations and Conventions -The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119). +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [@!RFC2119] [@!RFC8174] when, and only when, they appear in all capitals, as shown here. diff --git a/matroska_tags.xml b/matroska_tags.xml index 4b5cbcae..a9e04ef9 100644 --- a/matroska_tags.xml +++ b/matroska_tags.xml @@ -90,7 +90,7 @@ Conductor/performer refinement. This is akin to the [TPE3](http://id3.org/id3v2.3.0#TPE3). - This is akin to the [IART tag in RIFF](https://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html). + This is akin to the [IART tag in RIFF][@RIFF.tags]. The name of the assistant director. diff --git a/notes.md b/notes.md index 9ef12811..f94f949d 100644 --- a/notes.md +++ b/notes.md @@ -115,35 +115,35 @@ If SegmentB has a PrevUID to SegmentA but SegmentA has no NextUID, then the Matr As an example, three `Segments` can be Hard Linked as a `Linked Segment` through cross-referencing each other with `SegmentUID`, `PrevUID`, and `NextUID`, as in this table. -file name | `SegmentUID` | `PrevUID` | `NextUID` -:-----------|:-----------------------------------|:-----------------------------------|:--------- -`start.mkv` | `71000c23cd31099853fbc94dd984a5dd` | n/a | `a77b3598941cb803eac0fcdafe44fac9` -`middle.mkv`| `a77b3598941cb803eac0fcdafe44fac9` | `71000c23cd31099853fbc94dd984a5dd` | `6c92285fa6d3e827b198d120ea3ac674` -`end.mkv` | `6c92285fa6d3e827b198d120ea3ac674` | `a77b3598941cb803eac0fcdafe44fac9` | n/a +file name | `SegmentUID` | `PrevUID` | `NextUID` +:-----------|:----------------------------------|:----------------------------------|:--------- +`start.mkv` | 71000c23cd310998 53fbc94dd984a5dd | n/a | a77b3598941cb803 eac0fcdafe44fac9 +`middle.mkv`| a77b3598941cb803 eac0fcdafe44fac9 | 71000c23cd310998 53fbc94dd984a5dd | 6c92285fa6d3e827 b198d120ea3ac674 +`end.mkv` | 6c92285fa6d3e827 b198d120ea3ac674 | a77b3598941cb803 eac0fcdafe44fac9 | n/a An other example where only the `NextUID` Element is used. -file name | `SegmentUID` | `PrevUID` | `NextUID` -:-----------|:-----------------------------------|:-----------------------------------|:--------- -`start.mkv` | `71000c23cd31099853fbc94dd984a5dd` | n/a | `a77b3598941cb803eac0fcdafe44fac9` -`middle.mkv`| `a77b3598941cb803eac0fcdafe44fac9` | n/a | `6c92285fa6d3e827b198d120ea3ac674` -`end.mkv` | `6c92285fa6d3e827b198d120ea3ac674` | n/a | n/a +file name | `SegmentUID` | `PrevUID` | `NextUID` +:-----------|:----------------------------------|:----------------------------------|:--------- +`start.mkv` | 71000c23cd310998 53fbc94dd984a5dd | n/a | a77b3598941cb803 eac0fcdafe44fac9 +`middle.mkv`| a77b3598941cb803 eac0fcdafe44fac9 | n/a | 6c92285fa6d3e827 b198d120ea3ac674 +`end.mkv` | 6c92285fa6d3e827 b198d120ea3ac674 | n/a | n/a A next example where only the `PrevUID` Element is used. -file name | `SegmentUID` | `PrevUID` | `NextUID` -:-----------|:-----------------------------------|:-----------------------------------|:--------- -`start.mkv` | `71000c23cd31099853fbc94dd984a5dd` | n/a | n/a -`middle.mkv`| `a77b3598941cb803eac0fcdafe44fac9` | `71000c23cd31099853fbc94dd984a5dd` | n/a -`end.mkv` | `6c92285fa6d3e827b198d120ea3ac674` | `a77b3598941cb803eac0fcdafe44fac9` | n/a +file name | `SegmentUID` | `PrevUID` | `NextUID` +:-----------|:----------------------------------|:----------------------------------|:--------- +`start.mkv` | 71000c23cd310998 53fbc94dd984a5dd | n/a | n/a +`middle.mkv`| a77b3598941cb803 eac0fcdafe44fac9 | 71000c23cd310998 53fbc94dd984a5dd | n/a +`end.mkv` | 6c92285fa6d3e827 b198d120ea3ac674 | a77b3598941cb803 eac0fcdafe44fac9 | n/a In this example only the `middle.mkv` is using the `PrevUID` and `NextUID` Elements. -file name | `SegmentUID` | `PrevUID` | `NextUID` -:-----------|:-----------------------------------|:-----------------------------------|:--------- -`start.mkv` | `71000c23cd31099853fbc94dd984a5dd` | n/a | n/a -`middle.mkv`| `a77b3598941cb803eac0fcdafe44fac9` | `71000c23cd31099853fbc94dd984a5dd` | `6c92285fa6d3e827b198d120ea3ac674` -`end.mkv` | `6c92285fa6d3e827b198d120ea3ac674` | n/a | n/a +file name | `SegmentUID` | `PrevUID` | `NextUID` +:-----------|:----------------------------------|:----------------------------------|:--------- +`start.mkv` | 71000c23cd310998 53fbc94dd984a5dd | n/a | n/a +`middle.mkv`| a77b3598941cb803 eac0fcdafe44fac9 | 71000c23cd310998 53fbc94dd984a5dd | 6c92285fa6d3e827 b198d120ea3ac674 +`end.mkv` | 6c92285fa6d3e827 b198d120ea3ac674 | n/a | n/a ## Medium Linking diff --git a/rfc_backmatter_codec.md b/rfc_backmatter_codec.md new file mode 100644 index 00000000..8a7ee50e --- /dev/null +++ b/rfc_backmatter_codec.md @@ -0,0 +1,13 @@ + +{backmatter} + + + + Standard for Binary Floating-Point Arithmetic + + Institute of Electrical and Electronics Engineers + + + + + diff --git a/rfc_backmatter_matroska.md b/rfc_backmatter_matroska.md new file mode 100644 index 00000000..993503c1 --- /dev/null +++ b/rfc_backmatter_matroska.md @@ -0,0 +1,2 @@ + +{backmatter} diff --git a/rfc_backmatter_tags.md b/rfc_backmatter_tags.md new file mode 100644 index 00000000..eca67945 --- /dev/null +++ b/rfc_backmatter_tags.md @@ -0,0 +1,12 @@ + +{backmatter} + + + + RIFF Tags + + Exiftool + + undated + + diff --git a/subtitles.md b/subtitles.md index 220b7b88..686e7b8b 100644 --- a/subtitles.md +++ b/subtitles.md @@ -31,80 +31,80 @@ Each .BMP will be stored in its own Block. The Timestamp with be stored in the B Here is an example .IDX file: - -~~~ - # VobSub index file, v7 (do not modify this line!) - # - # To repair desynchronization, you can insert gaps this way: - # (it usually happens after vob id changes) - # - # delay: [sign]hh:mm:ss:ms - # - # Where: - # [sign]: +, - (optional) - # hh: hours (0 <= hh) - # mm/ss: minutes/seconds (0 <= mm/ss <= 59) - # ms: milliseconds (0 <= ms <= 999) - # - # Note: You can't position a sub before the previous with a negative - # value. - # - # You can also modify timestamps or delete a few subs you don't like. - # Just make sure they stay in increasing order. - - # Settings - - # Original frame size - size: 720x480 - - # Origin, relative to the upper-left corner, can be overloaded by - # alignment - org: 0, 0 - - # Image scaling (hor,ver), origin is at the upper-left corner or at - # the alignment coord (x, y) - scale: 100%, 100% - - # Alpha blending - alpha: 100% - - # Smoothing for very blocky images (use OLD for no filtering) - smooth: OFF - - # In millisecs - fadein/out: 50, 50 - - # Force subtitle placement relative to (org.x, org.y) - align: OFF at LEFT TOP - - # For correcting non-progressive desync. (in millisecs or hh:mm:ss:ms) - # Note: Not effective in DirectVobSub, use "delay: ... " instead. - time offset: 0 - - # ON: displays only forced subtitles, OFF: shows everything - forced subs: OFF - - # The original palette of the DVD - palette: 000000, 7e7e7e, fbff8b, cb86f1, 7f74b8, e23f06, 0a48ea, \ - b3d65a, 6b92f1, 87f087, c02081, f8d0f4, e3c411, 382201, e8840b, fdfdfd - - # Custom colors (transp idxs and the four colors) - custom colors: OFF, tridx: 0000, colors: 000000, 000000, 000000, \ - 000000 - - # Language index in use - langidx: 0 - - # English - id: en, index: 0 - # Uncomment next line to activate alternative name in DirectVobSub / - # Windows Media Player 6.x - # alt: English - # Vob/Cell ID: 1, 1 (PTS: 0) - timestamp: 00:00:01:101, filepos: 000000000 - timestamp: 00:00:08:708, filepos: 000001000 -~~~ - +``` + # VobSub index file, v7 (do not modify this line!) + # + # To repair desynchronization, you can insert gaps this way: + # (it usually happens after vob id changes) + # + # delay: [sign]hh:mm:ss:ms + # + # Where: + # [sign]: +, - (optional) + # hh: hours (0 <= hh) + # mm/ss: minutes/seconds (0 <= mm/ss <= 59) + # ms: milliseconds (0 <= ms <= 999) + # + # Note: You can't position a sub before the previous with a negative + # value. + # + # You can also modify timestamps or delete a few subs you don't + # like. Just make sure they stay in increasing order. + + # Settings + + # Original frame size + size: 720x480 + + # Origin, relative to the upper-left corner, can be overloaded by + # alignment + org: 0, 0 + + # Image scaling (hor,ver), origin is at the upper-left corner or at + # the alignment coord (x, y) + scale: 100%, 100% + + # Alpha blending + alpha: 100% + + # Smoothing for very blocky images (use OLD for no filtering) + smooth: OFF + + # In millisecs + fadein/out: 50, 50 + + # Force subtitle placement relative to (org.x, org.y) + align: OFF at LEFT TOP + + # For correcting non-progressive desync. (in millisecs or + # hh:mm:ss:ms) + # Note: Not effective in DirectVobSub, use "delay: ... " instead. + time offset: 0 + + # ON: displays only forced subtitles, OFF: shows everything + forced subs: OFF + + # The original palette of the DVD + palette: 000000, 7e7e7e, fbff8b, cb86f1, 7f74b8, e23f06, 0a48ea, \ + b3d65a, 6b92f1, 87f087, c02081, f8d0f4, e3c411, 382201, e8840b, \ + fdfdfd + + # Custom colors (transp idxs and the four colors) + custom colors: OFF, tridx: 0000, colors: 000000, 000000, 000000, \ + 000000 + + # Language index in use + langidx: 0 + + # English + id: en, index: 0 + # Uncomment next line to activate alternative name in DirectVobSub / + # Windows Media Player 6.x + # alt: English + # Vob/Cell ID: 1, 1 (PTS: 0) + timestamp: 00:00:01:101, filepos: 000000000 + timestamp: 00:00:08:708, filepos: 000001000 +``` First, lines beginning with "#" are removed. These are comments to make text file editing easier, and as this is not a text file, they aren't needed. @@ -115,19 +115,20 @@ Finally, the "timestamp" will be used to set the Block's timestamp. Once it is s Once all of these items are removed, the data to store in the CodecPrivate SHOULD look like this: ``` - size: 720x480 - org: 0, 0 - scale: 100%, 100% - alpha: 100% - smooth: OFF - fadein/out: 50, 50 - align: OFF at LEFT TOP - time offset: 0 - forced subs: OFF - palette: 000000, 7e7e7e, fbff8b, cb86f1, 7f74b8, e23f06, 0a48ea, \ - b3d65a, 6b92f1, 87f087, c02081, f8d0f4, e3c411, 382201, e8840b, fdfdfd - custom colors: OFF, tridx: 0000, colors: 000000, 000000, 000000, \ - 000000 + size: 720x480 + org: 0, 0 + scale: 100%, 100% + alpha: 100% + smooth: OFF + fadein/out: 50, 50 + align: OFF at LEFT TOP + time offset: 0 + forced subs: OFF + palette: 000000, 7e7e7e, fbff8b, cb86f1, 7f74b8, e23f06, 0a48ea, \ + b3d65a, 6b92f1, 87f087, c02081, f8d0f4, e3c411, 382201, e8840b, \ + fdfdfd + custom colors: OFF, tridx: 0000, colors: 000000, 000000, 000000, \ + 000000 ``` There SHOULD also be two Blocks containing one image each with the timestamps "00:00:01:101" and "00:00:08:708". @@ -183,16 +184,22 @@ The second, "[V4 Styles]", is a list of style definitions. A style describe how For example this : ``` -Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding -Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,0,1,1,2,2,5,5,30,0,0 +Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, \ +TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, \ +Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding +Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,\ +0,1,1,2,2,5,5,30,0,0 ``` The third, "[Events]", is the list of text you want to display at the right timing. You can specify some attribute here. Like the style to use for this event (MUST be defined in the list), the position of the text (Left, Right, Vertical Margin), an effect. Name is mostly used by translator to know who said this sentence. Timing is in h:mm:ss.cc (centisec). ``` -Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text -Dialogue: Marked=0,0:02:40.65,0:02:41.79,Wolf main,Cher,0000,0000,0000,,Et les enregistrements de ses ondes delta ? -Dialogue: Marked=0,0:02:42.42,0:02:44.15,Wolf main,autre,0000,0000,0000,,Toujours rien. +Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, \ +Effect, Text +Dialogue: Marked=0,0:02:40.65,0:02:41.79,Wolf main,Cher,0000,0000,\ +0000,,Et les enregistrements de ses ondes delta ? +Dialogue: Marked=0,0:02:42.42,0:02:44.15,Wolf main,autre,0000,0000,\ +0000,,Toujours rien. ``` "[Pictures]" or "[Fonts]" part can be found in some SSA file, they contains UUE-encoded pictures/font but those features are only used by Sub Station Alpha, i.e. no filter (Vobsub/Avery Lee Subtiler filter) use them. @@ -207,8 +214,10 @@ Here is an example of an SSA file. [Script Info] ; This is a Sub Station Alpha v4 script. ; For Sub Station Alpha info and downloads, -; go to [http://www.eswat.demon.co.uk/](http://www.eswat.demon.co.uk/) -; or email [kotus@eswat.demon.co.uk](mailto:kotus@eswat.demon.co.uk) +; go to \ +; [http://www.eswat.demon.co.uk/](http://www.eswat.demon.co.uk/) +; or email \ +; [kotus@eswat.demon.co.uk](mailto:kotus@eswat.demon.co.uk) Title: Wolf's rain 2 Original Script: Anime-spirit Ishin-francais Original Translation: Coolman @@ -219,22 +228,30 @@ ScriptType: v4.00 Collisions: Normal PlayResY: 1024 PlayDepth: 0 -Wav: 0, 128697,D:\Alex\Anime\- Fansub -\- TAFF -\Wolf's Rain\WR_-_02_Wav.wav +Wav: 0, 128697,D:\Alex\Anime\- Fansub -\- TAFF -\WR_-_02_Wav.wav Wav: 0, 120692,H:\team truc\WR_-_02.wav Wav: 0, 116504,E:\sub\wolf's_rain\WOLF'S RAIN 02.wav LastWav: 3 Timer: 100,0000 [V4 Styles] -Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding -Style: Default,Arial,20,65535,65535,65535,-2147483640,-1,0,1,3,0,2,30,30,30,0,0 -Style: Titre_episode,Akbar,140,15724527,65535,65535,986895,-1,0,1,1,0,3,30,30,30,0,0 -Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,0,1,1,2,2,5,5,30,0,0 +Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, \ +TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, \ +Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding +Style: Default,Arial,20,65535,65535,65535,-2147483640,-1,0,1,3,0,2,\ +30,30,30,0,0 +Style: Titre_episode,Akbar,140,15724527,65535,65535,986895,-1,0,1,1,\ +0,3,30,30,30,0,0 +Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,\ +0,1,1,2,2,5,5,30,0,0 [Events] -Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text -Dialogue: Marked=0,0:02:40.65,0:02:41.79,Wolf main,Cher,0000,0000,0000,,Et les enregistrements de ses ondes delta ? -Dialogue: Marked=0,0:02:42.42,0:02:44.15,Wolf main,autre,0000,0000,0000,,Toujours rien. +Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, \ +Effect, Text +Dialogue: Marked=0,0:02:40.65,0:02:41.79,Wolf main,Cher,0000,0000,\ +0000,,Et les enregistrements de ses ondes delta ? +Dialogue: Marked=0,0:02:42.42,0:02:44.15,Wolf main,autre,0000,0000,\ +0000,,Toujours rien. ``` Here is what would be placed into the CodecPrivate element. @@ -243,8 +260,10 @@ Here is what would be placed into the CodecPrivate element. [Script Info] ; This is a Sub Station Alpha v4 script. ; For Sub Station Alpha info and downloads, -; go to [http://www.eswat.demon.co.uk/](http://www.eswat.demon.co.uk/) -; or email [kotus@eswat.demon.co.uk](mailto:kotus@eswat.demon.co.uk) +; go to \ +; [http://www.eswat.demon.co.uk/](http://www.eswat.demon.co.uk/) +; or email \ +; [kotus@eswat.demon.co.uk](mailto:kotus@eswat.demon.co.uk) Title: Wolf's rain 2 Original Script: Anime-spirit Ishin-francais Original Translation: Coolman @@ -255,17 +274,22 @@ ScriptType: v4.00 Collisions: Normal PlayResY: 1024 PlayDepth: 0 -Wav: 0, 128697,D:\Alex\Anime\- Fansub -\- TAFF -\Wolf's Rain\WR_-_02_Wav.wav +Wav: 0, 128697,D:\Alex\Anime\- Fansub -\- TAFF -\WR_-_02_Wav.wav Wav: 0, 120692,H:\team truc\WR_-_02.wav Wav: 0, 116504,E:\sub\wolf's_rain\WOLF'S RAIN 02.wav LastWav: 3 Timer: 100,0000 [V4 Styles] -Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding -Style: Default,Arial,20,65535,65535,65535,-2147483640,-1,0,1,3,0,2,30,30,30,0,0 -Style: Titre_episode,Akbar,140,15724527,65535,65535,986895,-1,0,1,1,0,3,30,30,30,0,0 -Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,0,1,1,2,2,5,5,30,0,0 +Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, \ +TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, \ +Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding +Style: Default,Arial,20,65535,65535,65535,-2147483640,-1,0,1,3,0,2,\ +30,30,30,0,0 +Style: Titre_episode,Akbar,140,15724527,65535,65535,986895,-1,0,1,1,\ +0,3,30,30,30,0,0 +Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,\ +0,1,1,2,2,5,5,30,0,0 ``` And here are the two blocks that would be generated. @@ -274,7 +298,8 @@ Block's timestamp: 00:02:40.650 BlockDuration: 00:00:01.140 ``` -1,,Wolf main,Cher,0000,0000,0000,,Et les enregistrements de ses ondes delta ? +1,,Wolf main,Cher,0000,0000,0000,,Et les enregistrements de ses \ +ondes delta ? ``` Block's timestamp: 00:02:42.420 @@ -348,7 +373,8 @@ STYLE background-image: linear-gradient(to bottom, dimgray, lightgray); color: papayawhip; } -/* Style blocks cannot use blank lines nor "dash dash greater than" */ +/* Style blocks cannot use blank lines nor "dash dash greater \ +than" */ NOTE comment blocks can be used between style blocks. @@ -381,7 +407,8 @@ Example entry 2: Another entry. This one has multiple lines. 00:01:03.000 --> 00:01:06.500 position:90% align:right size:35% -Example entry 3: That stuff to the right of the timestamps are cue settings. +Example entry 3: That stuff to the right of the timestamps are cue \ +settings. 00:03:10.000 --> 00:03:20.000 Example entry 4: Entries can even include timestamps. @@ -401,7 +428,8 @@ STYLE background-image: linear-gradient(to bottom, dimgray, lightgray); color: papayawhip; } -/* Style blocks cannot use blank lines nor "dash dash greater than" */ +/* Style blocks cannot use blank lines nor "dash dash greater \ +than" */ NOTE comment blocks can be used between style blocks. @@ -460,7 +488,8 @@ NOTE style blocks cannot appear after the first cue. Example Cue 3: timestamp 00:01:03.000, duration 00:00:03.500, Block's content: ``` -Example entry 3: That stuff to the right of the timestamps are cue settings. +Example entry 3: That stuff to the right of the timestamps are cue \ +settings. ``` BlockAddition's content ends with an empty line as there's no Cue Identifier and there were no WebVTT Comment blocks: diff --git a/tools.mak b/tools.mak new file mode 100644 index 00000000..410acf6b --- /dev/null +++ b/tools.mak @@ -0,0 +1,47 @@ +ifeq ($(shell curl --version >/dev/null 2>&1 || echo FAIL),) +download = curl -f -L -- "$(1)" > "$@.tmp" && touch $@.tmp && mv $@.tmp $@ +else ifeq ($(shell wget --version >/dev/null 2>&1 || echo FAIL),) +download = rm -f $@.tmp && \ + wget --passive -c -p -O $@.tmp "$(1)" && \ + touch $@.tmp && \ + mv $@.tmp $@ +else ifeq ($(which fetch >/dev/null 2>&1 || echo FAIL),) +download = rm -f $@.tmp && \ + fetch -p -o $@.tmp "$(1)" && \ + touch $@.tmp && \ + mv $@.tmp $@ +else +download = $(error Neither curl nor wget found!) +endif + +# mmark +mmark_$(MMARK_VERSION)_linux_amd64.tgz: + $(call download,https://github.com/mmarkdown/mmark/releases/download/v$(MMARK_VERSION)/mmark_$(MMARK_VERSION)_$(MMARK_OS)_$(MMARK_MACHINE).tgz) + +mmark: mmark_$(MMARK_VERSION)_linux_amd64.tgz + tar xvzf $^ + touch $@ + +.buildmmark: mmark + touch $@ + +.uninstall_mmark: + $(RM) mmark + +# xml2rfc +.buildxml2rfc: + pip install --user "xml2rfc~=2.30.0" + touch $@ + +.uninstall_xml2rfc: + pip uninstall -y xml2rfc + +# xsltproc +.buildxsltproc: + @echo "Install xsltproc: sudo apt install xsltproc" + +# xmllint +.buildxmllint: + @echo "Install xmllint: sudo apt install libxml2-utils" + +clean: .uninstall_mmark .uninstall_xml2rfc