Relicense to GPLv3
[muse-el.git] / etc / muse.rnc
blob9dd6fa23f182096a49383ebcc028ca5615b84713
1 namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
2 namespace rng = "http://relaxng.org/ns/structure/1.0"
4 #   Emacs Muse RELAX NG Schema v. 1.0
5 #   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
7 #   Author: Brad Collins (brad AT chenla DOT org)
8 #   Maintainer: Michael Olson (mwolson AT gnu DOT org)
10 #   This is free software; you can redistribute it and/or modify it
11 #   under the terms of the GNU General Public License as published by
12 #   the Free Software Foundation; either version 3 of the License, or
13 #   (at your option) any later version. This material is distributed in
14 #   the hope that it will be useful, but WITHOUT ANY WARRANTY; without
15 #   even the implied warranty of MERCHANTABILITY or FITNESS FOR A
16 #   PARTICULAR PURPOSE. See the GNU General Public License for more
17 #   details.You should have received a copy of the GNU General Public
18 #   License along with this file; if not, write to the Free Software
19 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 #   02111-1307, USA.
22 # Commentary:
24 #   RelaxNG Compact syntax can be converted into RelaxNG XML Syntax,
25 #   DTD format and XML Schema language using free tools.
27 #   Emacs users are encouraged to use James Clarke's nxml-mode for
28 #   editing and validating XML files.  If you are in nxml-mode use the
29 #   command C-c C-s C-f to point to this schema file, say yes if you
30 #   are asked if you want to copy the file to your location, and then
31 #   C-c C-s C-a can be used to reload the schema if you make changes
32 #   to the file.
34 # History:
36 #   Version 0.1:
37 #    - Original version by Brad Collins.
39 #   Version 0.2:
40 #    - Hacked it to the point of working with Muse's QuickStart
41 #      document.
43 #   Version 0.3:
44 #    - Permit lists to be nested.
46 #   Version 1.0:
47 #    - Permit paragraph-level markup, such as links, to appear in
48 #      table lines.
49 #    - Support multiple definitions in a definition list.
50 #    - Permit a list to be nested inside of a definition.
51 #    - Permit a link to be inside of a title.
52 #    - Permit emphasis to be inside of other emphasis.
54 # Contributors:
56 # Schema:
58 start = MUSE
60    ## root element
61 MUSE =
62    element MUSE {
63       muse.element.pageinfo?
64       & muse.element.section*
65       & muse.element.p*
66       & muse.element.blockquote*
67       & muse.element.table*
68       & muse.element.list*
69       & muse.element.hr*
70       & muse.element.image*
71       & muse.element.example*
72       & muse.element.verse*
73   }
75 # ------------------------------------------------
76 #  Pageinfo elements
77 # ------------------------------------------------
78     ## pageinfo element used for metadata
79     ## for the page
80 muse.element.pageinfo = element pageinfo {
81    muse.element.title?
82    & muse.element.author?
83    & muse.element.maintainer?
84    & muse.element.pubdate? }?
86    ## page title element
87 muse.element.title = element title {
88    muse.element.link*
89    & text }?
91    ## page author element
92 muse.element.author = element author { text }?
94    ## page maintainer element
95 muse.element.maintainer = element maintainer  { text }?
97   ## page publication date element
98 muse.element.pubdate = element pubdate { text }?
100 # ------------------------------------------------
101 #  Block elements
102 # ------------------------------------------------
104 muse.element.section = element section {
105    muse.attribute.type?
106    & muse.attribute.level?
107    & muse.element.section*
108    & muse.element.title*
109    & muse.element.p*
110    & muse.element.blockquote*
111    & muse.element.table*
112    & muse.element.list*
113    & muse.element.hr*
114    & muse.element.image*
115    & muse.element.example*
116    & muse.element.verse*
117    & text }?
119   ## blockquote element
120 muse.element.blockquote = element blockquote {
121    muse.element.title?
122    & muse.element.p* }?
124    ## paragraph element
125 muse.element.p = element p {
126    muse.element.code*
127    & muse.element.format*
128    & muse.element.image*
129    & muse.element.link*
130    & muse.element.image*
131    & muse.element.anchor*
132    & muse.element.footnote*
133    & text }?
135    ## example element
136 muse.element.example = element example { text }?
138   ## verse element
139 muse.element.verse = element verse {
140    muse.element.line* }?
142   ## verse line element
143 muse.element.line = element line {
144    muse.element.code*
145    & muse.element.format*
146    & muse.element.image*
147    & muse.element.link*
148    & muse.element.image*
149    & muse.element.anchor*
150    & muse.element.footnote*
151    & text }?
153 # ------------------------------------------------
154 #  Unordered list elements
155 # ------------------------------------------------
157 muse.element.list = element list {
158    muse.attribute.type?
159    & muse.element.item* }?
161 muse.element.item = element item {
162    muse.element.term?
163    & muse.element.definition*
164    & muse.element.code*
165    & muse.element.format*
166    & muse.element.image*
167    & muse.element.link*
168    & muse.element.p*
169    & muse.element.blockquote*
170    & muse.element.table*
171    & muse.element.example*
172    & muse.element.verse*
173    & muse.element.list*
174    & text }?
176 # ------------------------------------------------
177 #  Definition list elements
178 # ------------------------------------------------
180 muse.element.term = element term {
181    muse.element.code*
182    & muse.element.format*
183    & muse.element.image*
184    & muse.element.link*
185    & muse.element.image*
186    & text }?
188    ## def
189 muse.element.definition = element definition {
190    muse.element.code*
191    & muse.element.format*
192    & muse.element.image*
193    & muse.element.link*
194    & muse.element.image*
195    & muse.element.list*
196    & text }?
198 # ------------------------------------------------
199 #   Inline elements
200 # ------------------------------------------------
202   ## format element
203   ## used for emphasis, underlining, and centering paragraphs
204 muse.element.format = element format {
205    muse.attribute.type?
206    & muse.attribute.level?
207    & muse.element.code*
208    & muse.element.format*
209    & text }?
211   ## code element
212   ## used for small pieces of monospace text, like commands
213 muse.element.code = element code { text }?
215 muse.element.image = element image { muse.attribute.href? }?
217    ## horizontal rule element
218 muse.element.hr = element hr { empty }?
220    ## footnote element
221 muse.element.footnote = element footnote { text }?
223    ## anchor element
224 muse.element.anchor = element anchor { muse.attribute.id }?
226    ## link element
227 muse.element.link = element link {
228    muse.attribute.type?
229    & muse.attribute.href
230    & text }?
232 # ------------------------------------------------
233 #   Attributes
234 # ------------------------------------------------
236    ## type attribute
237 muse.attribute.type = attribute type { text }?
239    ## level attribute
240 muse.attribute.level = attribute level { text }?
242    ## href attribute -- must have valid URI
243 muse.attribute.href = attribute href { xsd:anyURI }?
245   ## id attribute
246 muse.attribute.id = attribute id { text }?
248 # ------------------------------------------------
249 #  Table elements
250 # ------------------------------------------------
252   ## table element
253 muse.element.table = element table {
254    muse.element.tbody*
255    & muse.element.thead*
256    & muse.element.tfoot* }?
258   ## table body element
259 muse.element.tbody = element tbody { muse.element.tr* }?
261   ## table header element
262 muse.element.thead = element thead { muse.element.tr* }?
264   ## table footer element
265 muse.element.tfoot = element tfoot { muse.element.tr* }?
267   ## table row element
268 muse.element.tr = element tr {
269    muse.element.td*
270  & muse.element.th* }?
272   ## td element
273 muse.element.td = element td {
274    muse.element.code*
275    & muse.element.format*
276    & muse.element.image*
277    & muse.element.link*
278    & muse.element.image*
279    & muse.element.anchor*
280    & muse.element.footnote*
281    & text }?
283   ## th element
284 muse.element.th = element th {
285    muse.element.code*
286    & muse.element.format*
287    & muse.element.image*
288    & muse.element.link*
289    & muse.element.image*
290    & muse.element.anchor*
291    & muse.element.footnote*
292    & text }?