summaryrefslogtreecommitdiff
blob: 2d21a4a959240fac0f83fdccc9bd841e4dd2a8da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Copyright 2019-2021 Gentoo Authors

# Distributed under the terms of the MIT/X11 license
# or the CC-BY-SA-4.0 license (dual-licensed)

# Document Type Definition for the Gentoo Devmanual

# Based on common.dtd from GuideXML

namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"

block.class =
  p
  | pre
  | codesample
  | note
  | important
  | warning
  | todo
  | figure
  | table
  | ul
  | ol
  | dl
attrib.class = b | c | e
inline.class = attrib.class | d | uri
all.class = block.class | inline.class
guide = element guide { guide.attlist, chapter, \include* }
guide.attlist &=
  attribute root { "true" }?,
  attribute self { text }?
\include = element include { include.attlist, empty }
include.attlist &= attribute href { text }
chapter =
  element chapter { chapter.attlist, title, (body | section), section* }
chapter.attlist &= empty
section =
  element section {
    section.attlist, title, (body | subsection), subsection*
  }
section.attlist &= empty
subsection =
  element subsection {
    subsection.attlist, title, (body | subsubsection), subsubsection*
  }
subsection.attlist &= empty
subsubsection =
  element subsubsection { subsubsection.attlist, title, body }
subsubsection.attlist &= empty
# Title texts are used as anchors, so allow only text attributes
title = element title { title.attlist, (text | attrib.class)* }
title.attlist &= empty
body =
  element body { body.attlist, (authors | contentsTree | block.class)+ }
body.attlist &= empty
authors = element authors { authors.attlist, (author+ | authorlist+) }
authors.attlist &= empty
author = element author { author.attlist, (text | inline.class)* }
author.attlist &=
  attribute name { text },
  attribute email { text }?
authorlist = element authorlist { authorlist.attlist, empty }
authorlist.attlist &=
  attribute title { text },
  attribute href { text }
contentsTree = element contentsTree { contentsTree.attlist, empty }
contentsTree.attlist &=
  attribute maxdepth { text }?,
  attribute root { text }?,
  attribute extraction { text }?
p = element p { p.attlist, (text | inline.class)* }
p.attlist &= empty
pre = element pre { pre.attlist, text }
pre.attlist &= empty
codesample = element codesample { codesample.attlist, text }
codesample.attlist &=
  attribute lang { "c" | "ebuild" | "make" | "m4" | "sgml" },
  attribute numbering { "lines" }?
note = element note { note.attlist, (text | inline.class)* }
note.attlist &= empty
important =
  element important { important.attlist, (text | inline.class)* }
important.attlist &= empty
warning = element warning { warning.attlist, (text | inline.class)* }
warning.attlist &= empty
todo = element todo { todo.attlist, (text | inline.class)* }
todo.attlist &= empty
figure = element figure { figure.attlist, empty }
figure.attlist &=
  attribute link { text },
  attribute short { text }?,
  attribute caption { text }?
table = element table { table.attlist, tr+ }
table.attlist &= empty
tr = element tr { tr.attlist, (th | ti)+ }
tr.attlist &= empty
th = element th { th.attlist, (text | inline.class)* }
th.attlist &=
  attribute colspan { text }?,
  attribute rowspan { text }?,
  [ a:defaultValue = "left" ]
  attribute align { "left" | "center" | "right" }?
ti = element ti { ti.attlist, (text | all.class)* }
ti.attlist &=
  attribute colspan { text }?,
  attribute rowspan { text }?,
  attribute nowrap { text }?,
  [ a:defaultValue = "left" ]
  attribute align { "left" | "center" | "right" }?
ul = element ul { ul.attlist, li+ }
ul.attlist &= attribute class { text }?
ol = element ol { ol.attlist, li+ }
ol.attlist &= empty
li = element li { li.attlist, (text | all.class)* }
li.attlist &= empty
dl = element dl { dl.attlist, (dt | dd)+ }
dl.attlist &= empty
dt = element dt { dt.attlist, (text | inline.class)* }
dt.attlist &= empty
dd = element dd { dd.attlist, (text | all.class)* }
dd.attlist &= empty
b = element b { b.attlist, (text | inline.class)* }
b.attlist &= empty
c = element c { c.attlist, (text | inline.class)* }
c.attlist &= empty
e = element e { e.attlist, (text | inline.class)* }
e.attlist &= empty
d = element d { d.attlist, empty }
d.attlist &= empty
uri = element uri { uri.attlist, (text | inline.class)* }
uri.attlist &= attribute link { text }?
start = guide