]> Git — Sourcephile - doclang.git/blob - schema/dtc.rnc
stack: add stack.yaml.lock
[doclang.git] / schema / dtc.rnc
1 document = head, body
2 head = about?
3 about = element "about" {(title | attribute "url" url | author | editor | date | tag | link | serie | header)*}
4 header = anyElem plain
5 tag = element "tag" text
6 author = element "author" entity
7 editor = element "editor" entity
8 date = element "date" {(attribute "year" xsd:int)? & (attribute "month" xsd:nat1)? & (attribute "day" xsd:nat1)?}
9 entity = name? & (attribute "street" text)? & (attribute "zipcode" text)? & (attribute "city" text)? & (attribute "region" text)? & (attribute "country" text)? & (attribute "email" text)? & (attribute "tel" text)? & (attribute "fax" text)? & (attribute "url" url)? & (element "org" entity)?
10 link = element "link" {name? & (attribute "href" url)? & (attribute "rel" text)? & (attribute "type" text)? & plainNode*}
11 serie = element "serie" {name? & (attribute "id" text)?}
12 alias = element "alias" {id?}
13 body = (element "section" {commonAttrs, title, alias*, body} | block)*
14 include = element "include" {(attribute "href" path)?}
15 block = para | blockToC | blockToF | blockIndex | blockFigure | blockReferences
16 blockToC = element "toc" {commonAttrs, (attribute "depth" xsd:nat)?}
17 blockToF = element "tof" {commonAttrs, (element "ul" {(element "li" {element "para" text})*})?}
18 blockIndex = element "index" {commonAttrs, (element "ul" {(element "li" {element "para" {text*}})*})?}
19 blockFigure = element "figure" {commonAttrs, attribute "type" text, title?, para*}
20 blockReferences = element "references" {commonAttrs, reference*}
21 reference = element "reference" {id, (title | attribute "url" url | author | editor | date | tag | link | serie | header)*}
22 para = paraItems | paraItem
23 paraItem = element "ol" {(element "li" {attribute "name" text, para*})*} | element "ul" {(element "li" {para*})*} | element "artwork" {attribute "type" text, text} | element "quote" {attribute "type" text, para*} | plainNode+ | comment
24 paraItems = element "para" {commonAttrs, paraItem*}
25 plain = plainNode*
26 plainNode = text | element "br" empty | element "b" plain | element "code" plain | element "del" plain | element "i" plain | element "q" plain | element "sc" plain | element "sub" plain | element "sup" plain | element "u" plain | element "note" {para*} | element "iref" {attribute "to" text, plain} | element "eref" {attribute "to" url, plain} | element "ref" {to, plain} | element "rref" {to, plain}
27 commonAttrs = id? & class?
28 ident = text
29 title = element "title" plain
30 name = attribute "name" text
31 url = text
32 path = text
33 to = attribute "to" ident
34 id = attribute "id" ident