1 |
commit: 12fb6e610b2ed3f486ff3a6eb397f5eae0811e5d |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 11 10:02:20 2019 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 11 10:02:20 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=12fb6e61 |
7 |
|
8 |
devbook.xsl: Support class="list-group" in <ul> element. |
9 |
|
10 |
This replaces <list-group-d>, which was only used for the list of |
11 |
eclasses. Remove <list-group-u> which was unused. |
12 |
|
13 |
Update devbook.dtd and bin/gen-eclass-html.sh accordingly. |
14 |
|
15 |
Generated output in eclass-reference/index.html is identical as |
16 |
before, except for an (intentionally) removed empty line before the |
17 |
closing </div>. |
18 |
|
19 |
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> |
20 |
|
21 |
bin/gen-eclass-html.sh | 8 ++++---- |
22 |
devbook.dtd | 9 ++++----- |
23 |
devbook.xsl | 24 +++++++++++++++--------- |
24 |
3 files changed, 23 insertions(+), 18 deletions(-) |
25 |
|
26 |
diff --git a/bin/gen-eclass-html.sh b/bin/gen-eclass-html.sh |
27 |
index 9705d04..e7a72ab 100755 |
28 |
--- a/bin/gen-eclass-html.sh |
29 |
+++ b/bin/gen-eclass-html.sh |
30 |
@@ -135,16 +135,16 @@ installed by emerging <c>app-portage/eclass-manpages</c>. |
31 |
<section> |
32 |
<title>Contents</title> |
33 |
<body> |
34 |
-<list-group-d> |
35 |
+<ul class="list-group"> |
36 |
EOF |
37 |
|
38 |
for i in $(find $OUTPUTDIR/ -maxdepth 1 -mindepth 1 -type d | sort); do |
39 |
- echo "<uri link=\"$(basename $i)/index.html\">$(basename $i) Reference</uri>" >> ${OUTPUTDIR}/text.xml |
40 |
+ echo "<li><uri link=\"$(basename $i)/index.html\">$(basename $i) Reference</uri></li>" >> ${OUTPUTDIR}/text.xml |
41 |
done |
42 |
|
43 |
cat << EOF >> ${OUTPUTDIR}/text.xml |
44 |
- |
45 |
-</list-group-d></body> |
46 |
+</ul> |
47 |
+</body> |
48 |
</section> |
49 |
</chapter> |
50 |
</guide> |
51 |
|
52 |
diff --git a/devbook.dtd b/devbook.dtd |
53 |
index 96d1c9d..dac1815 100644 |
54 |
--- a/devbook.dtd |
55 |
+++ b/devbook.dtd |
56 |
@@ -5,8 +5,7 @@ |
57 |
<!-- Based on common.dtd from GuideXML --> |
58 |
|
59 |
<!ENTITY % block.class "p|pre|codesample|note|important|warning|todo |
60 |
- |figure|table|ul|ol|dl |
61 |
- |list-group-u|list-group-d"> |
62 |
+ |figure|table|ul|ol|dl"> |
63 |
<!ENTITY % inline.class "sup|sub|b|c|d|e|path|uri"> |
64 |
<!ENTITY % all.class "%block.class;|%inline.class;"> |
65 |
|
66 |
@@ -75,7 +74,10 @@ |
67 |
align (left|center|right) "left"> |
68 |
|
69 |
<!ELEMENT ul (li)+> |
70 |
+<!ATTLIST ul class CDATA #IMPLIED> |
71 |
+ |
72 |
<!ELEMENT ol (li)+> |
73 |
+ |
74 |
<!ELEMENT li (#PCDATA|%all.class;)*> |
75 |
|
76 |
<!ELEMENT dl (dt, dd)+> |
77 |
@@ -83,9 +85,6 @@ |
78 |
<!-- The following is strange, but devbook.xsl expects only p elements --> |
79 |
<!ELEMENT dd (p)+> |
80 |
|
81 |
-<!ELEMENT list-group-u (#PCDATA|%all.class;)*> |
82 |
-<!ELEMENT list-group-d (#PCDATA|%all.class;)*> |
83 |
- |
84 |
<!ELEMENT sup (#PCDATA|%inline.class;)*> |
85 |
<!ELEMENT sub (#PCDATA|%inline.class;)*> |
86 |
<!ELEMENT b (#PCDATA|%inline.class;)*> |
87 |
|
88 |
diff --git a/devbook.xsl b/devbook.xsl |
89 |
index cadd975..94cbf96 100644 |
90 |
--- a/devbook.xsl |
91 |
+++ b/devbook.xsl |
92 |
@@ -204,15 +204,21 @@ |
93 |
</xsl:template> |
94 |
|
95 |
<xsl:template match="ul"> |
96 |
- <ul><xsl:apply-templates/></ul> |
97 |
- </xsl:template> |
98 |
- |
99 |
- <xsl:template match="list-group-d"> |
100 |
- <div class="list-group"><xsl:apply-templates><xsl:with-param name="class">list-group-item</xsl:with-param></xsl:apply-templates></div> |
101 |
- </xsl:template> |
102 |
- |
103 |
- <xsl:template match="list-group-u"> |
104 |
- <ul class="list-group"><xsl:apply-templates><xsl:with-param name="class">list-group-item</xsl:with-param></xsl:apply-templates></ul> |
105 |
+ <xsl:choose> |
106 |
+ <xsl:when test="@class='list-group'"> |
107 |
+ <div class="list-group"> |
108 |
+ <xsl:for-each select="li"> |
109 |
+ <xsl:apply-templates> |
110 |
+ <xsl:with-param name="class">list-group-item</xsl:with-param> |
111 |
+ </xsl:apply-templates> |
112 |
+ <xsl:value-of select='$newline'/> |
113 |
+ </xsl:for-each> |
114 |
+ </div> |
115 |
+ </xsl:when> |
116 |
+ <xsl:otherwise> |
117 |
+ <ul><xsl:apply-templates/></ul> |
118 |
+ </xsl:otherwise> |
119 |
+ </xsl:choose> |
120 |
</xsl:template> |
121 |
|
122 |
<!-- Definition Lists --> |