about summary refs log tree commit diff stats
path: root/readme.html
diff options
context:
space:
mode:
Diffstat (limited to 'readme.html')
-rw-r--r--readme.html73
1 files changed, 73 insertions, 0 deletions
diff --git a/readme.html b/readme.html new file mode 100644 index 0000000..06dc9df --- /dev/null +++ b/readme.html
@@ -0,0 +1,73 @@
1<h1>Subtext, a layered document preperation system</h1>
2<p>This repo contains the source of my groff-aesthetic document preparator
3<code>subtext</code>.
4It's unique in that it's an
5<code>awk(1p)</code>
6script that compiles a source file to a
7shell script that you can pipe to
8<code>sh(1p)</code>.</p>
9<p>Doing things in this multi-layered way allows me to
10<ul><li>Build a rich writing environment using only off-the-shelf POSIX tools</li>
11<li>Use the same input to generate multiple outputs</li>
12<li>A cool third thing</li></ul>
13so I can truly write-once, run anywhere
14(or whatever the kids are saying these days).
15Plus, it looks kinda like
16<code>roff(1)</code>
17without having to remember all the arcane two-letter requests and macros.</p>
18
19<h2>Quickstart</h2>
20<p>An easy and quick way to start with <code>subtext</code> is to build this README:
21<pre><code>make readme</code></pre>
22Of course, I'd recommend reading readme.st in this repo
23to get a feel for the syntax as well.
24I've tried to use all the ways to inject control codes to illustrate it.</p>
25<p>However, this
26<em>quick start</em>
27is not really a good explanation of what's going on.
28For that, keep reading.</p>
29
30<h2>The layers of subtext, the subtextual layers</h2>
31<p>There are three main layers of <code>subtext</code>: the
32<b>awk</b>
33layer,
34<b>shell</b>
35layer,
36and, for lack of something better to call it, the
37<b>text</b>
38layer.
39These layers don't really reflect the order of expansions,
40but rather how I think they feel to the user
41and how they're reflected in syntax.
42<code>subtext</code>
43is inherently a line-based markup language,
44and each of these layers has its own line marker.</p>
45
46<h3>Awk layer: <code>%</code></h3>
47<p>The first thing that happens to any <code>subtext</code> source file is a pass through
48<code>subtext.awk</code>.
49While this awk script passes most things through to the next layers,
50there are two special directives at this layer you can use:</p>
51<dl><dt><code>%</code></dt>
52<dd>Comment the current line.
53<code>%</code>
54only works at the start of a line for comments.</dd>
55<dt><code>%so FILE</code></dt>
56<dd>Insert FILE verbatim at the line where this directive appears.
57FILE is searched in <code>$ST_SOPATH</code>,
58which by default is the current directory.</dd></dl>
59<p>I went ahead and reserved <code>%</code>-lines for future directives
60that need to be done at awk-time.</p>
61
62<h3>Shell layer: <code>#</code></h3>
63
64<i>todo</i>
65
66<h3>Text layer: <code>.</code></h3>
67
68<i>todo</i>
69
70<h2>Contributing</h2>
71<p>Send me an email or whatever :)
72This project is licensed under the BSD-3 license.
73See COPYING for details.</p>