~nme/nme/1.1

« back to all changes in this revision

Viewing changes to markup.html

  • Committer: michael.owens at linterra
  • Date: 2008-11-19 17:49:21 UTC
  • Revision ID: michael.owens@linterra.org-20081119174921-5rh22x5qdh6ltf4o
Initial submission.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!-- Generated by Nyctergatis Markup Engine, Mar 19 2008 00:22:07 -->
 
2
<html><body>
 
3
<h1>Markup of Nyctergatis Markup Engine</h1>
 
4
<p>Text with markup is plain text with a few character sequences
 
5
which are recognized by the markup processor and change the format of
 
6
the result. The result is styled text with titles, paragraphs with
 
7
justification, bold and italic faces, etc.</p>
 
8
<p>There are two kinds of markup constructs: blocks and inline.
 
9
Blocks are paragraphs (indented or not), headings, list items, table
 
10
cells, horizontal rules and block extensions. Inline constructs are
 
11
character styles, verbatim text and links; they are part of blocks.
 
12
Except in preformatted blocks, sequences of spaces or tabs are
 
13
replaced with single spaces.</p>
 
14
<h2>Paragraphs</h2>
 
15
<p>Paragraphs are made of lines whose first character is not one of
 
16
<tt>*#:;=</tt> nor sequence <tt>{{{</tt>, <tt>----</tt>, or
 
17
<tt>&lt;&lt;&lt;</tt>. Lines can begin with sequences <tt>**</tt> and
 
18
<tt>##</tt>.</p>
 
19
<p>Paragraphs end with blank lines or next heading, list, table,
 
20
indented paragraph, preformatted block of text, horizontal rule or
 
21
block extension. They can contain styled text, links, spans of
 
22
verbatim text, and inline extensions.</p>
 
23
<h3>Example</h3>
 
24
<pre>
 
25
This is a paragraph
 
26
written in two lines.
 
27
 
 
28
This is another paragraph.
 
29
</pre>
 
30
<h2>Indenting</h2>
 
31
<p>Indented paragraphs are paragraphs which begin with a colon.
 
32
Multiple colons define the level of indenting. Indented paragraphs
 
33
can contain styled text, links, spans of verbatim text, and inline
 
34
extensions.</p>
 
35
<h3>Example</h3>
 
36
<pre>
 
37
This is a normal paragraph.
 
38
:This is an indented
 
39
paragraph in two lines.
 
40
::This is more indented.
 
41
</pre>
 
42
<h2>Headings</h2>
 
43
<p>Headings are made of a single line beginning with an equal
 
44
character. The number of equal characters defines the level of title,
 
45
from main title (<tt>=</tt>) to sub-sub-subtitle (<tt>====</tt>).
 
46
Headings may end with a sequence of equal characters.</p>
 
47
<h3>Examples</h3>
 
48
<pre>
 
49
=Level 1 heading=
 
50
Paragraph
 
51
=Another level 1 heading, without trailing equal character
 
52
==Level 2 heading==
 
53
===Level 3 heading===
 
54
</pre>
 
55
<h2>Lists</h2>
 
56
<p>Lists are collections of items. There are three kinds of lists:
 
57
unnumbered lists, numbered lists, and definition lists. Lists can be
 
58
nested; they end with the next heading, indented paragraph, table, or
 
59
blank line.</p>
 
60
<p>Unnumbered lists are represented as indented paragraphs with a
 
61
bullet. Each item begins with a star character (<tt>*</tt>); it can
 
62
span multiple lines.</p>
 
63
<p>Numbered lists are represented as indented paragraphs with a
 
64
number. Items are numbered automatically with consecutive integers
 
65
starting at 1. Each item begins with a sharp character (<tt>#</tt>);
 
66
it can span multiple lines.</p>
 
67
<p>Definition lists are made of two kinds of items: title, typically
 
68
displayed in bold font, and definition, typically displayed indented.
 
69
Titles begin with a semicolon at the beginning of a line. Definitions
 
70
either follow the title, separated with a colon; or they begin on a
 
71
new line beginning with a colon.</p>
 
72
<p>List nesting can combine different kinds of lists. Sublist items
 
73
begin with multiple markers, the first one(s) corresponding to the
 
74
enclosing list(s). For instance, items of an unnumbered list nested
 
75
in a numbered list should start with <tt>#*</tt> at the beginning of
 
76
the line, without any preceding space. List markers must be used in a
 
77
consistent way; for example, <tt>##</tt> at the beginning of a line
 
78
in an unnumbered list is not interpreted as a second-level numbered
 
79
list item, but as monospace style (see below).</p>
 
80
<h3>Examples</h3>
 
81
<pre>
 
82
* First item of unnumbered list.
 
83
* Second
 
84
item, in two lines.
 
85
*Third item without space (spaces are optional).
 
86
 
 
87
# First item of numbered list.
 
88
# Second item.
 
89
#* First item on unnumbered sublist.
 
90
#* Second item.
 
91
# Thirst item of top-level numbered list.
 
92
 
 
93
; First title of definition list
 
94
: Definition of first item.
 
95
; Second title: Second definition
 
96
beginning on the same line.
 
97
 
 
98
Paragraph separated with a blank line.
 
99
</pre>
 
100
<h2>Tables</h2>
 
101
<p>Tables are rectangular array of cells. They are made of one line
 
102
per row. Each cell begins with character <tt>|</tt>. Heading cells
 
103
(typically displayed in bold face) begin with <tt>|=</tt>. Rows may
 
104
end with a trailing <tt>|</tt>.</p>
 
105
<h3>Example</h3>
 
106
<p>In the table below, the first row and the first column contain
 
107
headings. The very first cell is empty.</p>
 
108
<pre>
 
109
||=First column|=Second column
 
110
|=First row|Cell 1,1|Cell 1,2
 
111
|=Second row|Cell 2,1|Cell 2,2
 
112
</pre>
 
113
<h2>Preformatted</h2>
 
114
<p>Preformatted text is a block of text displayed literally,
 
115
including line feeds. Preformatted text is preceded with a line
 
116
containing <tt>{{{</tt> and is followed by a line containing
 
117
<tt>}}}</tt>.</p>
 
118
<h3>Example</h3>
 
119
<pre>
 
120
This is some C code:
 
121
{{{
 
122
double f(double x)
 
123
{
 
124
  return 2 * x;  // f(x) = 2x
 
125
}
 
126
}}}
 
127
</pre>
 
128
<p>In preformatted text, lines which begin with <tt>}}}</tt>, with
 
129
leading spaces or not, must have an additional space which is
 
130
discarded in the output.</p>
 
131
<h2>Horizontal rules</h2>
 
132
<p>Horizontal rules are single lines containing four hyphens.</p>
 
133
<h3>Example</h3>
 
134
<pre>
 
135
Paragraph.
 
136
----
 
137
Paragraph following a horizontal rule.
 
138
</pre>
 
139
<h2>Extensions</h2>
 
140
<p>Sequences <tt>&lt;&lt;</tt> and <tt>&lt;&lt;&lt;</tt> are reserved
 
141
for extensions.</p>
 
142
<h2>Character style</h2>
 
143
<p>Inside paragraphs, indented paragraphs, headings, list elements,
 
144
and table cells, the following two-character sequences toggle on or
 
145
off the corresponding style. It is not mandatory to nest spans of
 
146
styled characters between matching style sequences. Style is reset at
 
147
the end of text block.</p>
 
148
<table>
 
149
<tr><th>Markup</th>
 
150
<th>Style</th>
 
151
</tr>
 
152
<tr><td><tt>**</tt></td>
 
153
<td>Bold</td>
 
154
</tr>
 
155
<tr><td><tt>//</tt></td>
 
156
<td>Italic</td>
 
157
</tr>
 
158
<tr><td><tt>##</tt></td>
 
159
<td>Monospace</td>
 
160
</tr>
 
161
<tr><td><tt>,,</tt> (two commas)</td>
 
162
<td>Subscript</td>
 
163
</tr>
 
164
<tr><td><tt>^^</tt></td>
 
165
<td>Superscript</td>
 
166
</tr>
 
167
<tr><td><tt>__</tt> (two underscores)</td>
 
168
<td>Underlined</td>
 
169
</tr>
 
170
</table>
 
171
<p>Double stars and double sharps are interpreted as the beginning of
 
172
list items when they are the first characters of a line in the
 
173
context of lists. To be interpreted as style markup, they can be
 
174
preceded by a space.</p>
 
175
<h3>Example</h3>
 
176
<pre>
 
177
This is //italic text//, **bold text**,
 
178
and //**bold italic text**//.
 
179
</pre>
 
180
<h2>Escape character</h2>
 
181
<p>The tilde character, when followed by any character except space,
 
182
tab or line feed, is an escape character; it is not displayed and the
 
183
next character loses its special meaning, if any.</p>
 
184
<h3>Example</h3>
 
185
<pre>
 
186
Two stars: ~*~* or ~** or *~*; tilde: ~~.
 
187
</pre>
 
188
<p>is rendered as &quot;Two stars: ** or ** or **; tilde: ~.&quot;</p>
 
189
<h2>Verbatim</h2>
 
190
<p>Verbatim text is a sequence of characters enclosed between
 
191
<tt>{{{</tt> and <tt>}}}</tt>. After <tt>{{{</tt>, all characters are
 
192
output verbatim, without any markup interpreting, until the next
 
193
<tt>}}}</tt> or the end of text block. Multiple spaces and tabs and
 
194
single line feeds are still converted to single spaces, though.
 
195
Verbatim text is an alternative to the escape character; it is more
 
196
convenient for sequences of characters.</p>
 
197
<h3>Example</h3>
 
198
<pre>
 
199
{{{**}}} //{{{{{{xx}}}}}}//
 
200
</pre>
 
201
<p>is rendered as &quot;** <i>{{{xx}}}</i>&quot;.</p>
 
202
<h2>Line break</h2>
 
203
<p>Except in preformatted blocks, line breaks are not preserved. The
 
204
sequence <tt>\\</tt> forces a line break.</p>
 
205
<h3>Example</h3>
 
206
<pre>
 
207
The next line of this paragraph begins...\\here!
 
208
</pre>
 
209
<h2>Links</h2>
 
210
<p>Hypertext links (URLs) are enclosed between <tt>[[</tt> and
 
211
<tt>]]</tt>. The text displayed as the link is either the same as the
 
212
URL itself if there is no <tt>|</tt> character, or it is what follows
 
213
<tt>|</tt>. No markup is recognized in the URL part; what follows
 
214
<tt>|</tt> can contain styled text and verbatim text. Spaces
 
215
surrounding <tt>|</tt> are ignored.</p>
 
216
<h3>Examples</h3>
 
217
<pre>
 
218
* Simple link: [[http://www.calerga.com]]
 
219
* Link with link text: [[http://www.calerga.com | Calerga]]
 
220
* Link with styled link text: [[http://www.calerga.com | **Calerga**]]
 
221
</pre>
 
222
<hr />
 
223
<p>Copyright Yves Piguet, 24 October 2007 May be distributed with NME
 
224
or cited with proper attribution.</p>
 
225
</body></html>