From 3ca15b7de0d147c400199c5040a7f87ea92b0c32 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 6 Feb 2024 22:12:47 -0600 Subject: Update readme --- readme.html | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 3 deletions(-) (limited to 'readme.html') 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.
An easy and quick way to start with subtext
is to build this
-README:
+README:
make readme
Of course, I'd recommend reading readme.st in this repo
to get a feel for the syntax as well.
@@ -61,10 +61,73 @@ which by default is the current directory.
that need to be done at awk-time.
#
So what does subtext
do?
+It takes an input file or stream and converts it to a shell script
+which you can then pipe through sh(1)
.
+But it doesn't
+just
+do that.
+subtext
+also outputs various functions and variables and what-not
+to set up the environment in which the source document is expanded.
+Starting a line with #
puts the rest of the line in the code part,
+enabling you to set a title, say, with or
+define a function for a commonly-used thing in your file.
+For this README, I've written
+
#subtext()(code subtext)
+so I save about five characters every time.
.
The "text layer" of subtext is actually expanded to a shell here-doc
+so that you can use stuff like
+$(...)
+to call shell functions.
+But don't worry – I've made it easier to not shoot yourself in the foot.
+One $ is changed to \$ in the expansion,
+and more than one $ is changed to one less.
+So $$$ becomes $$, etc.
+if you really want to put the process number in your output.
+Oh, and ` are all escaped.
+Those were a bad idea from go.
In addition, lines beginning with
+.
+expand to
+$(...)
,
+and lines beginning with
+..COMMAND [ARGS]
+expand to
+$(COMMAND ARGS << ..
+and close the here-doc with
+..
+on a line by itself.
You can add the
+<< END-MARKER
+yourself if you want to specify your own end-marker.
Basically, this means you can write +
.h1 My cool article
+
+Here is a cool article.
+It is
+.i really
+cool.
+
+Here's what someone said about it:
+
+..blockquote cite="A fan"
+Wow, what a cool article!
+..
+The above translates to
+Here is a cool article. +It is +really +cool.
+Here's what someone said about it:
+Wow, what a cool article!
Since this README was generated from subtext source, +look at readme.st to get a better feel for the syntax.
+ +subtext