commit: 5fb4841a76b2dcfc5ec0e464f6aec698eb21a5ac
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 21 16:27:05 2023 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Oct 22 08:53:33 2023 +0000
URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=5fb4841a
devbook.xsl: Support type and start attributes for ordered lists
Simply copy them to the HTML output.
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
devbook.rnc | 14 +++++++++++---
devbook.rng | 13 ++++++++++++-
devbook.xsl | 7 ++++++-
3 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/devbook.rnc b/devbook.rnc
index 9fe44b8..158f372 100644
--- a/devbook.rnc
+++ b/devbook.rnc
@@ -1,4 +1,4 @@
-# Copyright 2022 Gentoo Authors
+# Copyright 2022-2023 Gentoo Authors
# Distributed under the terms of the MIT license
# or the CC-BY-SA-4.0 license (dual-licensed)
@@ -93,8 +93,16 @@ ti = element ti {
all
}
-ul = element ul { attribute class { "list-group" }?, li+ }
-ol = element ol { li+ }
+ul = element ul {
+ attribute class { "list-group" }?,
+ li+
+}
+
+ol = element ol {
+ attribute type { "1" | "A" | "a" | "I" | "i" }?,
+ li+
+}
+
li = element li { all }
dl = element dl { (dt | dd)+ }
diff --git a/devbook.rng b/devbook.rng
index cfca2b4..c3c616f 100644
--- a/devbook.rng
+++ b/devbook.rng
@@ -2,7 +2,7 @@
<!-- Auto-generated from devbook.rnc; do not edit! -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<!--
- Copyright 2022 Gentoo Authors
+ Copyright 2022-2023 Gentoo Authors
Distributed under the terms of the MIT license
or the CC-BY-SA-4.0 license (dual-licensed)
-->
@@ -326,6 +326,17 @@
</define>
<define name="ol">
<element name="ol">
+ <optional>
+ <attribute name="type">
+ <choice>
+ <value>1</value>
+ <value>A</value>
+ <value>a</value>
+ <value>I</value>
+ <value>i</value>
+ </choice>
+ </attribute>
+ </optional>
<oneOrMore>
<ref name="li"/>
</oneOrMore>
diff --git a/devbook.xsl b/devbook.xsl
index 9289eab..426b2fd 100644
--- a/devbook.xsl
+++ b/devbook.xsl
@@ -186,7 +186,12 @@
</xsl:template>
<xsl:template match="ol">
- <ol><xsl:apply-templates/></ol>
+ <ol>
+ <xsl:if test="@type">
+ <xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </ol>
</xsl:template>
<xsl:template match="ul">