aboutsummaryrefslogtreecommitdiff
path: root/README.html
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-01-30 17:36:49 +0000
committerJohn Ankarström <john@ankarstrom.se>2021-01-30 17:36:49 +0000
commit019d605894b903b483248a119d75691c46f5724d (patch)
tree48ed143549d774e076f198a8e302571a551dbe7d /README.html
parentfe8eb01e5adc6e07b89632b6cb60aac4855b87e0 (diff)
downloadem-019d605894b903b483248a119d75691c46f5724d.tar.gz
Update README
Diffstat (limited to 'README.html')
-rw-r--r--README.html180
1 files changed, 98 insertions, 82 deletions
diff --git a/README.html b/README.html
index f0c5676..576b50d 100644
--- a/README.html
+++ b/README.html
@@ -22,43 +22,86 @@ For examples, see the source code for this text (<a href="../tree/README">link</
</p>
<ol class="reflist" style="font-size: small;">
</ol>
-<h2>Implementation</h2>
<p>
Em is implemented in portable awk, with an rc script to bind it together.
The rc script can (more or less) trivially be translated to POSIX shell,
but the work has not been done yet.
</p>
-<h2>Syntax</h2>
<p>
Em's complete and exact syntax is defined by its implementation (<a href="../tree/emparse">link</a>),
-but this section contains a general description.
+but a general description follows below.
</p>
<ol class="reflist" style="font-size: small;">
</ol>
-<h3>Block-level formatting</h3>
+<hr/>
+<h2>Inline formatting</h2>
+<h3>Font style</h3>
<p>
-<b>A single empty line</b> always marks a block break. There is
-no exception to this rule. The line is removed in the final output.
+Italic, bold and teletype text is marked with the asterisk,
+the underscore and the backtick, respectively:
</p>
+<pre>
+Example of *italic text*, _bold text_ and `teletype text`.
+</pre>
<p>
-All blocks support inline formatting, except headings,
-preformatted blocks and terms in definition lists.
+The marks are only valid in certain positions:
</p>
+<ol>
+<li value="1">At word borders
+</li><li value="2">At the beginning of a word after an opening parenthesis
+</li><li value="3">At the end of a word before any of <tt>.,:;?!)</tt>
+</li><li value="4">At the end of a word before a closing parenthesis followed by any of <tt>.,:;?!</tt>
+</li>
+</ol>
+<hr/>
+<h3>Inline references</h3>
<p>
-One block cannot be put within another block. For example,
-it is impossible to put a paragraph or a preformatted block
-inside a list item. If you want paragraph lists, just use paragraphs:
+Inline references are created with square brackets:
</p>
<pre>
-1. Lorem ipsum dolor sit amet, consectetur adipiscing elit,
-sed do eiusmod tempor incididunt ut labore et dolore
-magna aliqua.
+Example of an inline reference [1].
+
+ [1] The quick brown fox ...
</pre>
+<p>
+For more information about references, see <i>Reference lists</i> below.
+</p>
+<hr/>
+<h3>Hyperlinks</h3>
+<p>
+Hyperlinks are a special case of inline references. When an inline
+reference refers to a reference containing only a web address,
+the inline reference is replaced with a hyperlink to that address.
+</p>
<pre>
-2. Ut enim ad minim veniam, quis nostrud exercitation
-ullamco laboris nisi ut aliquip ex ea commodo consequat.
+It is available for download [a].
+
+ [a] v1.tgz
</pre>
-<h4>Headings</h4>
+<p>
+The above example translates to the following HTML:
+</p>
+<pre>
+&lt;p&gt;It is available for download (&lt;a href="v1.tgz"&gt;link&lt;/a&gt;).
+&lt;/p&gt;
+</pre>
+<p>
+The default link text ("link") can be changed by setting
+the <tt>linktext</tt> environment variable.
+</p>
+<hr/>
+<h2>Block-level formatting</h2>
+<ul>
+<li><b>A single empty line marks a block break.</b> There is
+no exception to this rule. The line is removed in the final output.
+</li><li>All blocks support inline formatting, except headings,
+preformatted blocks and terms in definition lists.
+</li><li>One block cannot be put within another block. For example,
+it is impossible to put a paragraph or a preformatted block
+inside a list item.
+</li>
+</ul>
+<h3>Headings</h3>
<p>
Headings begin and end with the same number of equal signs:
</p>
@@ -67,44 +110,62 @@ Headings begin and end with the same number of equal signs:
== Second-level heading ==
</pre>
-<h4>Lists</h4>
+<hr/>
+<h3>Lists</h3>
+<p>
+<b>_All lists start with a single space_</b>, followed by some marker.
+</p>
<p>
-Lists start with a single space. There are four types of lists:
+<b>Unordered lists</b> are created with <tt>- </tt>:
</p>
<pre>
- This is an unordered list
- With two items
+</pre>
+<p>
+<b>Ordered lists</b> are created with <tt>n. </tt>:
- 1. This is an ordered list
- 2. With an item that spans
+1. This is an ordered list
+2. With an item that spans
two lines
-
- this is: a definition list
+</p>
+<p>
+<b>Definition lists</b> are created with <tt>term: </tt>:
+</p>
+<pre>
+ dinosaur: an animal
</pre>
+<p>
+<b>Reference lists</b> are created with <tt>[n]. </tt>:
+</p>
<pre>
[1] This is a reference list
[2] With two items
</pre>
+<h4>Nesting</h4>
<p>
-Unordered and ordered lists can be nested. An additional space
+Unordered and ordered lists can be nested. <b>An additional space</b>
at the beginning of the line increases the item level by one:
</p>
<pre>
- - First level
+ 1. First level
- Second level
- - First level
+ 2. First level
</pre>
+<h4>Reference lists</h4>
<p>
-A reference list is a special type of list, unique to em. It is a
-type of footnote list, to which you can make inline referencess
-like this:
+A reference list is a special type of list. It is a type of footnote list,
+to which you can make inline references:
</p>
<pre>
See footnote [1].
+
+ [1] The quick brown fox ...
</pre>
<p>
-There is a special type of reference list item called a <i>hyperlink
-reference</i>. It contains only a single word, without whitespace:
+<b>Note:</b> There is a special type of reference list item called a
+<i>hyperlink reference</i>. It contains only a single word,
+without whitespace:
</p>
<pre>
[1] http://example.com
@@ -116,17 +177,19 @@ but you can still reference them inline:
<pre>
You can download the file here [1].
</pre>
-<h4>Preformatted blocks</h4>
+<hr/>
+<h3>Preformatted blocks</h3>
<p>
-Preformatted blocks start with a single tab:
+<b>_Preformatted blocks start with a single tab:_</b>
</p>
<pre>
#include &lt;stdio.h&gt;
main() { puts("Hello world!\n"); }
</pre>
-<h4>Paragraphs</h4>
+<hr/>
+<h3>Paragraphs</h3>
<p>
-Paragraphs start with no space:
+<b>_Paragraphs start with no space:_</b>
</p>
<pre>
This is a paragraph
@@ -135,50 +198,3 @@ with two lines.
<pre>
This is another paragraph.
</pre>
-<h3>Inline formatting</h3>
-<p>
-<b>Italic, bold and teletype text</b> is marked with the asterisk,
-the underscore and the backtick, respectively:
-</p>
-<pre>
-Example of *italic text*.
-</pre>
-<p>
-The marks are only valid in certain positions:
-</p>
-<ol>
-<li value="1">At word borders
-</li><li value="2">At the beginning of a word after an opening parenthesis
-</li><li value="3">At the end of a word before any of <tt>.,:;?!)</tt>
-</li><li value="4">At the end of a word before a closing parenthesis followed by any of <tt>.,:;?!</tt>
-</li>
-</ol>
-<p>
-<b>Inline references</b> are created with square brackets:
-</p>
-<pre>
-Example of an inline reference [12].
-</pre>
-<p>
-They are valid in positions 1, 3 and 4.
-</p>
-<p>
-When referencing a hyperlink reference (see above),
-the reference is replaced with a link. For example:
-</p>
-<pre>
-It is available for download [1].
-
- [1] v1.tgz
-</pre>
-<p>
-translates into the following HTML:
-</p>
-<pre>
-&lt;p&gt;It is available for download (&lt;a href="v1.tgz"&gt;link&lt;/a&gt;).
-&lt;/p&gt;
-</pre>
-<p>
-The default link text ("link") can be changed by setting
-the <tt>linktext</tt> environment variable.
-</p>