blob: e8639b8abce3f6fa98a95e409c9a99970f3bf270 (
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
|
%{
This is just a simple document for toying around
}%
\import{../osxmlparser/book_domain.osxml}
\import{../osxmlparser/headings_domain.osxml}
% Define some local domain here
\domain#stuff
\import[rel=typesystem]{../osxmlparser/color.osxml}
\import[rel=domain]{../osxmlparser/book_domain.osxml}
\struct#fancy
\primitive#myLittleColor[type=color]
\parentRef[ref=book]
\fieldRef[ref="$default"]
\begin{book}
This might be some introductory text or a dedication.
\chapter#myFirstChapter
\heading{My first chapter}
Here we might have an introduction to the chapter.
\section#myFirstSection
\heading{A rather curious experiment}
\paragraph
Here we might find the actual section content.
\paragraph
Test
\section#mySndSection
Here we might find the actual section content.
% Create a simple fancy instance
\fancy{[10,g=10,b=10]}
%{
Note that this
\fancy [10,g=10,b=10]
will also work (since the braces are not counted as commands). However
\fancy [t=10,g=10,b=10]
will leave the fancy field empty and assign the data as string to the above
paragraph.
}%
%{
Another note: In the short term the behaviour of the "{" and "}" tokens should
be changed in the parser. They should only be parsed when they are valid (after
commands and after a closing field). This can easily be hacked in (albeit it
will be ugly)
}%
\end{book}
|