1 |
commit: 91ee1bae83604a11bd5b8d7a04ab978c88040184 |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 26 19:24:16 2019 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Dec 26 20:40:27 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=91ee1bae |
7 |
|
8 |
More conventional syntax of definition lists. |
9 |
|
10 |
Definition lists required only "p" elements as children of "dd". |
11 |
Change to a more conventional syntax where each "dt" element can be |
12 |
followed by one _or_more_ "dd" elements. This agrees with both |
13 |
GuideXML and HTML. |
14 |
|
15 |
Vertical spacing for "dd" should really be done in the CSS style |
16 |
sheet, instead of complicated XSL processing. |
17 |
|
18 |
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> |
19 |
|
20 |
devbook.dtd | 5 ++--- |
21 |
devbook.xsl | 11 +---------- |
22 |
devmanual.css | 5 +---- |
23 |
3 files changed, 4 insertions(+), 17 deletions(-) |
24 |
|
25 |
diff --git a/devbook.dtd b/devbook.dtd |
26 |
index 946a7f1..455397b 100644 |
27 |
--- a/devbook.dtd |
28 |
+++ b/devbook.dtd |
29 |
@@ -80,10 +80,9 @@ |
30 |
|
31 |
<!ELEMENT li (#PCDATA|%all.class;)*> |
32 |
|
33 |
-<!ELEMENT dl (dt, dd)+> |
34 |
+<!ELEMENT dl (dt, dd+)+> |
35 |
<!ELEMENT dt (#PCDATA|%inline.class;)*> |
36 |
-<!-- The following is strange, but devbook.xsl expects only p elements --> |
37 |
-<!ELEMENT dd (p)+> |
38 |
+<!ELEMENT dd (#PCDATA|%inline.class;)*> |
39 |
|
40 |
<!ELEMENT b (#PCDATA|%inline.class;)*> |
41 |
<!ELEMENT c (#PCDATA|%inline.class;)*> |
42 |
|
43 |
diff --git a/devbook.xsl b/devbook.xsl |
44 |
index da60097..a8a11f1 100644 |
45 |
--- a/devbook.xsl |
46 |
+++ b/devbook.xsl |
47 |
@@ -231,16 +231,7 @@ |
48 |
</xsl:template> |
49 |
|
50 |
<xsl:template match="dd"> |
51 |
- <dd> |
52 |
- <xsl:for-each select="p"> |
53 |
- <xsl:choose> |
54 |
- <xsl:when test="count(../p) = 1"><xsl:apply-templates/></xsl:when> |
55 |
- <xsl:when test="position() = 1"><p class="first"><xsl:apply-templates/></p></xsl:when> |
56 |
- <xsl:when test="position() = last()"><p class="last"><xsl:apply-templates/></p></xsl:when> |
57 |
- <xsl:otherwise><p><xsl:apply-templates/></p></xsl:otherwise> |
58 |
- </xsl:choose> |
59 |
- </xsl:for-each> |
60 |
- </dd> |
61 |
+ <dd><xsl:apply-templates/></dd> |
62 |
</xsl:template> |
63 |
|
64 |
<xsl:template match="important"> |
65 |
|
66 |
diff --git a/devmanual.css b/devmanual.css |
67 |
index 1507558..414ad1e 100644 |
68 |
--- a/devmanual.css |
69 |
+++ b/devmanual.css |
70 |
@@ -139,11 +139,8 @@ dt { |
71 |
font-weight: bold; |
72 |
} |
73 |
|
74 |
-dd p.first { |
75 |
+dd { |
76 |
margin-top: 0.2em; |
77 |
-} |
78 |
- |
79 |
-dd p.last { |
80 |
margin-bottom: 0.2em; |
81 |
} |