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.html69
1 files changed, 66 insertions, 3 deletions
diff --git a/readme.html b/readme.html index b6e2ec2..a42f9a9 100644 --- a/readme.html +++ b/readme.html
@@ -18,7 +18,7 @@ without having to remember all the arcane two-letter requests and macros.</p>
18 18
19<h2>Quickstart</h2> 19<h2>Quickstart</h2>
20<p>An easy and quick way to start with <code>subtext</code> is to build this 20<p>An easy and quick way to start with <code>subtext</code> is to build this
21<a href="/subtext/tree/readme.st">README</a>: 21<a href=/subtext/tree/readme.st>README</a>:
22<pre><code>make readme</code></pre> 22<pre><code>make readme</code></pre>
23Of course, I'd recommend reading readme.st in this repo 23Of course, I'd recommend reading readme.st in this repo
24to get a feel for the syntax as well. 24to get a feel for the syntax as well.
@@ -61,10 +61,73 @@ which by default is the current directory.</dd></dl>
61that need to be done at awk-time.</p> 61that need to be done at awk-time.</p>
62 62
63<h3>Shell layer: <code>#</code></h3> 63<h3>Shell layer: <code>#</code></h3>
64 64<p>So what does <code>subtext</code> do?
65<i>todo</i> 65It takes an input file or stream and converts it to a shell script
66which you can then pipe through <code>sh(1)</code>.
67But it doesn't
68<i>just</i>
69do that.
70<code>subtext</code>
71also outputs various functions and variables and what-not
72to set up the environment in which the source document is expanded.
73Starting a line with <code>#</code> puts the rest of the line in the code part,
74enabling you to set a title, say, with <code #title='Some title'></code> or
75define a function for a commonly-used thing in your file.
76For this README, I've written
77<code>#subtext()(code subtext)</code>
78so I save about five characters every time.</p>
66 79
67<h3>Text layer: <code>.</code></h3> 80<h3>Text layer: <code>.</code></h3>
81<p>The "text layer" of subtext is actually expanded to a shell here-doc
82so that you can use stuff like
83<code>$(...)</code>
84to call shell functions.
85But don't worry &ndash; I've made it easier to not shoot yourself in the foot.
86One $ is changed to \$ in the expansion,
87and more than one $ is changed to one less.
88So $$$ becomes $$, etc.
89if you really want to put the process number in your output.
90Oh, and ` are all escaped.
91Those were a bad idea from go.</p>
92<p>In addition, lines beginning with
93<code>.</code>
94expand to
95<code>$(...)</code>,
96and lines beginning with
97<code>..COMMAND&nbsp;[ARGS]</code>
98expand to
99<code>$(COMMAND&nbsp;ARGS&nbsp;<<&nbsp;..</code>
100and close the here-doc with
101<code>..</code>
102on a line by itself.</p>
103<p>You can add the
104<code><<&nbsp;END-MARKER</code>
105yourself if you want to specify your own end-marker.</p>
106<p>Basically, this means you can write
107<pre><code>.h1 My cool article
108
109Here is a cool article.
110It is
111.i really
112cool.
113
114Here's what someone said about it:
115
116..blockquote cite="A fan"
117Wow, what a cool article!
118..</code></pre></p>
119<p>The above translates to</p>
120<section style="border:1px solid;padding:0.5em"><h1>My cool article</h1>
121<p>Here is a cool article.
122It is
123<i>really</i>
124cool.</p>
125<p>Here's what someone said about it:</p>
126<blockquote cite=A fan>Wow, what a cool article!</blockquote></section>
127<p>Since this README was generated from subtext source,
128look at readme.st to get a better feel for the syntax.</p>
129
130<h2>Using <code>subtext</code></h2>
68 131
69<i>todo</i> 132<i>todo</i>
70 133