IDEAS: Add "publish to plain text" and "refresh index pages"
[muse-el.git] / etc / muse.rnc
blob265460fd981d363111f8a3f008c16a509e2aabf8
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.1
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 #   Version 1.1:
55 #    - Add the <cite> tag.
57 # Contributors:
59 # Schema:
61 start = MUSE
63    ## root element
64 MUSE =
65    element MUSE {
66       muse.element.pageinfo?
67       & muse.element.section*
68       & muse.element.p*
69       & muse.element.blockquote*
70       & muse.element.table*
71       & muse.element.list*
72       & muse.element.hr*
73       & muse.element.image*
74       & muse.element.example*
75       & muse.element.verse*
76   }
78 # ------------------------------------------------
79 #  Pageinfo elements
80 # ------------------------------------------------
81     ## pageinfo element used for metadata
82     ## for the page
83 muse.element.pageinfo = element pageinfo {
84    muse.element.title?
85    & muse.element.author?
86    & muse.element.maintainer?
87    & muse.element.pubdate? }?
89    ## page title element
90 muse.element.title = element title {
91    muse.element.link*
92    & text }?
94    ## page author element
95 muse.element.author = element author { text }?
97    ## page maintainer element
98 muse.element.maintainer = element maintainer  { text }?
100   ## page publication date element
101 muse.element.pubdate = element pubdate { text }?
103 # ------------------------------------------------
104 #  Block elements
105 # ------------------------------------------------
107 muse.element.section = element section {
108    muse.attribute.type?
109    & muse.attribute.level?
110    & muse.element.section*
111    & muse.element.title*
112    & muse.element.p*
113    & muse.element.blockquote*
114    & muse.element.table*
115    & muse.element.list*
116    & muse.element.hr*
117    & muse.element.image*
118    & muse.element.example*
119    & muse.element.verse*
120    & text }?
122   ## blockquote element
123 muse.element.blockquote = element blockquote {
124    muse.element.title?
125    & muse.element.p* }?
127    ## paragraph element
128 muse.element.p = element p {
129    muse.element.code*
130    & muse.element.cite*
131    & muse.element.format*
132    & muse.element.image*
133    & muse.element.link*
134    & muse.element.image*
135    & muse.element.anchor*
136    & muse.element.footnote*
137    & text }?
139    ## example element
140 muse.element.example = element example { text }?
142   ## verse element
143 muse.element.verse = element verse {
144    muse.element.line* }?
146   ## verse line element
147 muse.element.line = element line {
148    muse.element.code*
149    & muse.element.cite*
150    & muse.element.format*
151    & muse.element.image*
152    & muse.element.link*
153    & muse.element.image*
154    & muse.element.anchor*
155    & muse.element.footnote*
156    & text }?
158 # ------------------------------------------------
159 #  Unordered list elements
160 # ------------------------------------------------
162 muse.element.list = element list {
163    muse.attribute.type?
164    & muse.element.item* }?
166 muse.element.item = element item {
167    muse.element.term?
168    & muse.element.definition*
169    & muse.element.code*
170    & muse.element.cite*
171    & muse.element.format*
172    & muse.element.image*
173    & muse.element.link*
174    & muse.element.p*
175    & muse.element.blockquote*
176    & muse.element.table*
177    & muse.element.example*
178    & muse.element.verse*
179    & muse.element.list*
180    & text }?
182 # ------------------------------------------------
183 #  Definition list elements
184 # ------------------------------------------------
186 muse.element.term = element term {
187    muse.element.code*
188    & muse.element.cite*
189    & muse.element.format*
190    & muse.element.image*
191    & muse.element.link*
192    & muse.element.image*
193    & text }?
195    ## def
196 muse.element.definition = element definition {
197    muse.element.code*
198    & muse.element.cite*
199    & muse.element.format*
200    & muse.element.image*
201    & muse.element.link*
202    & muse.element.image*
203    & muse.element.list*
204    & text }?
206 # ------------------------------------------------
207 #   Inline elements
208 # ------------------------------------------------
210   ## format element
211   ## used for emphasis, underlining, and centering paragraphs
212 muse.element.format = element format {
213    muse.attribute.type?
214    & muse.attribute.level?
215    & muse.element.code*
216    & muse.element.cite*
217    & muse.element.format*
218    & text }?
220   ## cite element
221   ## used for citing sources
222 muse.element.cite = element cite {
223    muse.attribute.type?
224    & text }?
226   ## code element
227   ## used for small pieces of monospace text, like commands
228 muse.element.code = element code { text }?
230 muse.element.image = element image { muse.attribute.href? }?
232    ## horizontal rule element
233 muse.element.hr = element hr { empty }?
235    ## footnote element
236 muse.element.footnote = element footnote { text }?
238    ## anchor element
239 muse.element.anchor = element anchor { muse.attribute.id }?
241    ## link element
242 muse.element.link = element link {
243    muse.attribute.type?
244    & muse.attribute.href
245    & text }?
247 # ------------------------------------------------
248 #   Attributes
249 # ------------------------------------------------
251    ## type attribute
252 muse.attribute.type = attribute type { text }?
254    ## level attribute
255 muse.attribute.level = attribute level { text }?
257    ## href attribute -- must have valid URI
258 muse.attribute.href = attribute href { xsd:anyURI }?
260   ## id attribute
261 muse.attribute.id = attribute id { text }?
263 # ------------------------------------------------
264 #  Table elements
265 # ------------------------------------------------
267   ## table element
268 muse.element.table = element table {
269    muse.element.tbody*
270    & muse.element.thead*
271    & muse.element.tfoot* }?
273   ## table body element
274 muse.element.tbody = element tbody { muse.element.tr* }?
276   ## table header element
277 muse.element.thead = element thead { muse.element.tr* }?
279   ## table footer element
280 muse.element.tfoot = element tfoot { muse.element.tr* }?
282   ## table row element
283 muse.element.tr = element tr {
284    muse.element.td*
285  & muse.element.th* }?
287   ## td element
288 muse.element.td = element td {
289    muse.element.code*
290    & muse.element.cite*
291    & muse.element.format*
292    & muse.element.image*
293    & muse.element.link*
294    & muse.element.image*
295    & muse.element.anchor*
296    & muse.element.footnote*
297    & text }?
299   ## th element
300 muse.element.th = element th {
301    muse.element.code*
302    & muse.element.cite*
303    & muse.element.format*
304    & muse.element.image*
305    & muse.element.link*
306    & muse.element.image*
307    & muse.element.anchor*
308    & muse.element.footnote*
309    & text }?