|
1 | 1 | <!DOCTYPE HTML>
|
2 | 2 |
|
3 | 3 | <!--
|
4 |
| - * This file copyright (C) 2020-2023, Peter Johnson (gravatar.com/delphidabbler) |
| 4 | + * This file copyright (C) 2020-2024, Peter Johnson (gravatar.com/delphidabbler) |
5 | 5 | * and is licensed under the MIT License: https://opensource.org/licenses/MIT
|
6 | 6 | *
|
7 | 7 | * DelphiDabbler Code Snippets Database Documentation: REML markup language
|
|
41 | 41 | </div>
|
42 | 42 | </div>
|
43 | 43 |
|
44 |
| - <nav id="contents"> |
45 |
| - <ul> |
46 |
| - <li> |
47 |
| - <a href="#intro">Introduction</a> |
48 |
| - </li> |
49 |
| - <li> |
50 |
| - <a href="#tags">Tags</a> |
51 |
| - </li> |
52 |
| - <li> |
53 |
| - <a href="#entities">Character Entities</a> |
54 |
| - </li> |
55 |
| - </ul> |
56 |
| - </nav> |
57 |
| - |
58 | 44 | </header>
|
59 | 45 |
|
60 |
| -<section id="intro"> |
| 46 | +<section id="about"> |
61 | 47 |
|
62 | 48 | <h1>
|
63 |
| - Introduction |
| 49 | + About REML |
64 | 50 | </h1>
|
65 | 51 |
|
66 | 52 | <p>
|
67 | 53 | REML is a little markup language that can be used to style text. It is used in the Code Snippets collection's meta data for certain properties of a snippet.
|
68 | 54 | </p>
|
69 |
| - <p> |
70 |
| - The REML language is a SGML language similar to a greatly simplified XHTML. The are a small number of tags and character entities that can be used. |
71 |
| - </p> |
72 |
| - <aside> |
73 |
| - <strong>Note:</strong> The language described here is REML v4. Earlier versions are obsolete. |
74 |
| - </aside> |
75 |
| - |
76 |
| -</section> |
77 |
| - |
78 |
| -<section id="tags"> |
79 |
| - |
80 |
| - <h1> |
81 |
| - Tags |
82 |
| - </h1> |
83 | 55 |
|
84 | 56 | <p>
|
85 |
| - There are two types of tags: block level and in-line. |
| 57 | + REML is a SGML language similar to HTML, albeit much smaller. A small number of tags and character entities are supported. |
86 | 58 | </p>
|
87 | 59 |
|
88 | 60 | <p>
|
89 |
| - If an unrecognised tag is encountered an REML code the interpreter <em>should</em> report an error. However, providing start and end tags are matched, the interpreter <em>may</em> choose to simply ignore the tags. |
| 61 | + This collection supports REML v4. Earlier versions are obsolete. |
| 62 | + See the <a href="https://htmlpreview.github.io/?https://raw.githubusercontent.com/delphidabbler/reml/main/docs/reml-v4.html">REML v4 language definition</a> from the <a href="https://github.com/delphidabbler/reml"><code>delphidabbler/reml</code></a> repository for full details. |
90 | 63 | </p>
|
91 | 64 |
|
92 |
| - <h2> |
93 |
| - Block Level Tags |
94 |
| - </h2> |
95 |
| - |
96 |
| - <p> |
97 |
| - Block level tags separate the enclosed text into paragraphs of some description. The supported tags are: |
98 |
| - </p> |
99 |
| - <ul class="half-spaced"> |
100 |
| - <li> |
101 |
| - <code class="value"><p>...</p></code> – Renders the enclosed markup as a simple paragraph. |
102 |
| - </li> |
103 |
| - <li> |
104 |
| - <code class="value"><heading>...</heading></code> – Renders the enclosed markup as a heading. |
105 |
| - </li> |
106 |
| - </ul> |
107 |
| - <p> |
108 |
| - The following rules apply to the use of block level tags: |
109 |
| - </p> |
110 |
| - <ul class="unspaced"> |
111 |
| - <li> |
112 |
| - The tags <span class="very-strong">must not</span> be nested. |
113 |
| - </li> |
114 |
| - <li> |
115 |
| - The tags <span class="very-strong">must</span> be matched, e.g. <code class="value"><p></code> must have a matching <code class="value"></p></code>. |
116 |
| - </li> |
117 |
| - <li> |
118 |
| - All text <em>should</em> be embedded within block level tags, e.g. <code class="value"><heading>heading</heading><p>text</p></code> or simply <code class="value"><p>text</p></code>. |
119 |
| - </li> |
120 |
| - <li> |
121 |
| - White space between blocks is permitted but <span class="very-strong">must</span> be ignored. |
122 |
| - </li> |
123 |
| - </ul> |
124 |
| - <p> |
125 |
| - Here is a valid example: |
126 |
| - </p> |
127 |
| - <pre class="sample"><heading>Hello</heading> |
128 |
| -<p>Hello World</p></pre> |
129 |
| - <p> |
130 |
| - Strictly speaking, the following example is invalid code – all occurrences of <code class="value">wrong</code> are in error because they are not contained within block tags. |
131 |
| - </p> |
132 |
| - <pre class="sample">wrong <heading>blah</heading> wrong <p>blah</p> wrong</pre> |
133 |
| - <p> |
134 |
| - However interpreting code <em>may</em> interpret this permissively. If this is done the text outside blocks <span class="very-strong">must</span> be interpreted as if it was enclosed in <code class="value"><p></code> and <code class="value"></p></code> tags. Therefore the above code would be interpreted as: |
135 |
| - </p> |
136 |
| - <pre class="sample"><p>wrong </p><heading>blah</heading><p>wrong </p><p>blah</p><p>wrong</p></pre> |
137 | 65 | <aside>
|
138 | 66 | <p>
|
139 |
| - <p> |
140 |
| - <strong>Note</strong> |
141 |
| - </p> |
142 |
| - <p> |
143 |
| - The Code Snippets Database collection v2.0.x contains such non-conforming REML. Therefore REML interpreters designed for use with that version of the collection <span class="very-strong">must</span> be able to handle text without enclosing block tags. |
144 |
| - </p> |
| 67 | + Before v2.1.0 of the collection, not all REML content was fully compliant with the specification: some text did not have enclosing block tags. Any REML interpreter designed to work with those versions <span class="very-strong">must</span> handle such text "permissively" as described in the language definition. |
145 | 68 | </p>
|
146 | 69 | <p>
|
147 |
| - From v2.1.0 of the collection all REML is fully conformant and REML interpreters designed only for v2.1.0 or later are <span class="very-strong">not required</span> to handle text with enclosing tags. |
| 70 | + From v2.1.0 the collection is fully compliant with the REML specification. Any interpreters that only need to handle v2.1.0 and later are <span class="very-strong">not required</span> to handle text outside enclosing tags. |
148 | 71 | </p>
|
149 | 72 | </aside>
|
150 | 73 |
|
151 |
| - <h2> |
152 |
| - Inline Tags |
153 |
| - </h2> |
154 |
| - |
155 |
| - <p> |
156 |
| - In-line tags format the text enclosed between the start and end tags. |
157 |
| - </p> |
158 |
| - <p> |
159 |
| - Here are the available in-line tags: |
160 |
| - </p> |
161 |
| - <ul class="half-spaced"> |
162 |
| - <li> |
163 |
| - <code class="value"><strong>...</strong></code> – Renders the enclosed markup with strong emphasis. |
164 |
| - </li> |
165 |
| - <li> |
166 |
| - <code class="value"><em>...</em></code> – Emphasises the enclosed markup. |
167 |
| - </li> |
168 |
| - <li> |
169 |
| - <code class="value"><var>...</var></code> – Used to indicate the enclosed markup is a variable. |
170 |
| - </li> |
171 |
| - <li> |
172 |
| - <code class="value"><warning>...</warning></code> – Used for warning text. |
173 |
| - </li> |
174 |
| - <li> |
175 |
| - <code class="value"><mono>...</mono></code> – Renders markup in a mono-spaced font. |
176 |
| - </li> |
177 |
| - <li> |
178 |
| - <code class="value"><a href="url">...</a></code> – Creates a hyper-link. The <code class="value">href</code> attribute <span class="very-strong">must</span> specify the required URL, which <span class="very-strong">must</span> use one of the <code class="value">http</code>, <code class="value">https</code> or <code class="value">file</code> protocols; others are not permitted. If you use the <code class="value">file</code> protocol it <span class="very-strong">must</span> reference a valid local or network file. |
179 |
| - </li> |
180 |
| - </ul> |
181 |
| - <p> |
182 |
| - The following rules apply to the use of in-line tags: |
183 |
| - </p> |
184 |
| - <ul class="unspaced"> |
185 |
| - <li> |
186 |
| - In-line tags <span class="very-strong">must</span> be embedded inside a block level tag. E.g. <code class="value"><p>one<strong>two</strong>three</p></code>. However those REML interpreters that allow for the omission of some block level tags relax this restriction (see above). |
187 |
| - </li> |
188 |
| - <li> |
189 |
| - Tags <span class="very-strong">must</span> match. E.g. <code class="value"><em></code> must be matched with <code class="value"></em></code>. |
190 |
| - </li> |
191 |
| - <li> |
192 |
| - Tags may be nested, providing the tags match. E.g. <code class="value"><em>blah <var>blah</var></em></code> is valid but <code class="value"><em>blah <var>blah</em></var></code> is not. |
193 |
| - </li> |
194 |
| - </ul> |
195 |
| - <p> |
196 |
| - Examples: |
197 |
| - </p> |
198 |
| - <pre class="sample"><p>Make stuff <strong>stand out</strong>.</p> |
199 |
| -<p><em>Emphasised <warning>warning!</warning></em></p> |
200 |
| -<p>Refer to a function <var>parameter</var>.</p> |
201 |
| -<p>Use the: <mono>Windows</mono> unit.</p> |
202 |
| -<p>See this <a href="http://example.com">example</a>.</p></pre> |
203 |
| - |
204 | 74 | </section>
|
205 | 75 |
|
206 |
| -<section id="entities"> |
| 76 | +<section id="examples"> |
207 | 77 |
|
208 | 78 | <h1>
|
209 |
| - Character Entities |
| 79 | + Examples |
210 | 80 | </h1>
|
211 | 81 |
|
212 | 82 | <p>
|
213 |
| - A few symbolic character entities are supported in REML. Here is the complete list: |
| 83 | + Here are some examples of valid REML markup. |
214 | 84 | </p>
|
215 |
| - <ul class="half-spaced"> |
216 |
| - <li> |
217 |
| - <code class="value">&lt;</code> for <code class="value"><</code> |
218 |
| - </li> |
219 |
| - <li> |
220 |
| - <code class="value">&gt;</code> for <code class="value">></code> |
221 |
| - </li> |
222 |
| - <li> |
223 |
| - <code class="value">&quot;</code> for <code class="value">"</code> |
224 |
| - </li> |
225 |
| - <li> |
226 |
| - <code class="value">&amp;</code> for <code class="value">&</code> |
227 |
| - </li> |
228 |
| - <li> |
229 |
| - <code class="value">&copy;</code> for <code class="value">©</code> |
230 |
| - </li> |
231 |
| - </ul> |
232 | 85 |
|
233 |
| - <aside> |
234 |
| - <strong>Note:</strong> the '<' and '&' characters are special within the markup and cannot be used literally. You <span class="very-strong">must</span> use the <code class="value">&lt;</code> character entity in place of <code class="value"><</code> and <code class="value">&amp;</code> instead of <code class="value">&</code>. For example to write <code class="value">x<y</code> in REML use <code class="value">x&lt;y</code> and to write <code class="value">you & me</code> use <code class="value">you &amp; me</code>. |
235 |
| - </aside> |
| 86 | + <pre class="sample"><heading>Hello</heading> |
| 87 | +<p>Hello World</p></pre> |
| 88 | + |
| 89 | + <pre class="sample"><p>Make stuff <strong>stand out</strong>.</p></pre> |
236 | 90 |
|
237 |
| - <p> |
238 |
| - To express other special symbols for which there is no symbolic character entity, numeric character entities can be used. For example to display the '¶' character (Unicode <em>pilcrow sign</em>) use <code class="value">&#182;</code>. |
239 |
| - </p> |
| 91 | + <pre class="sample"><p><em>Emphasised <warning>warning!</warning></em></p></pre> |
240 | 92 |
|
241 |
| - <aside> |
242 |
| - <strong>Note:</strong> Numeric entities should be used with caution because the characters they represent may vary across different text encodings, whereas symbolic entities are safe across encodings. |
243 |
| - </aside> |
| 93 | + <pre class="sample"><p>Refer to a function <var>parameter</var>.</p></pre> |
244 | 94 |
|
245 |
| -</section> |
| 95 | + <pre class="sample"><p>Use the: <mono>Windows</mono> unit.</p></pre> |
| 96 | + |
| 97 | + <pre class="sample"><p>See this <a href="http://example.com">example</a>.</p></pre> |
246 | 98 |
|
247 |
| -<footer /> |
| 99 | + <pre class="sample"><p>Sometimes &quot;character entities&quot; are needed.</p></pre> |
| 100 | + |
| 101 | +</section> |
248 | 102 |
|
249 | 103 | </body>
|
250 | 104 |
|
|
0 commit comments