set pandoc 8 character tab stops for HTML conversion

We add `--tab-stop=8` to all `pandoc(1)` executions in order to set
a better tab stop indentation, especially for tab intended code blocks.

Changed `bin/pandoc-wrapper.sh` VERSION "1.5.3 2024-03-26"
to "1.6 2024-03-31".

Fixed `1991/brnstnd/sorta.README.md` so that the sorta code
is code blocks.

Removed unneeded paragraph group in copyright in `inc/footer.default.html`.

Performed `make www` to perform the above and test under macOS.
This commit is contained in:
Landon Curt Noll committed 2024-03-31 23:55:08 -07:00
1 parent 7141a1b808
commit b84c27ce02
402 files changed
+2414 -2396

No files matched your search

+27 -9
View File
@@ -2,8 +2,9 @@ The `sorta` scripts described below can sorta be found in this directory.
# [sorta.i2+2](sorta.i2+2)
```
2 2+#` [ about as basic as you can get ]ld
```
This script takes 2, adds 2 to it, and prints the result (with a
@@ -13,7 +14,9 @@ your machine produces a different result so that I can send you patches.
# [sorta.iarg0](sorta.iarg0)
```
0A` [ take arg 0, print it ]
```
This is self-explanatory.
@@ -21,7 +24,7 @@ This is self-explanatory.
# [sorta.icalc](sorta.icalc)
```
[D2sD3s]:Dld [ input m n, output m n m n ]ld
[2*1=d]:cld [ aux routine for :d recursion ]ld
@@ -55,6 +58,7 @@ This is self-explanatory.
1=D 1s# " & "T 1s#T " is "T &D& #T$ld " (" 1=2 ")"T `ld
1=D 1s# " | "T 1s#T " is "T D&1sD&& #T$ld " (" 1=2 ")"T `ld
1=D 1s# " ^ "T 1s#T " is "T 1=D&2sD&1sD&&&D& #T$ld " (" 1=2 ")"T `ld
```
`icalc` shows off `SORTA`'s understanding of integer arithmetic. You can run
it with up to two arguments; the arguments have default values of 27182
@@ -68,10 +72,11 @@ you can just look it up here.
# [sorta.idup](sorta.idup)
```
[ld#1_+1=y]:x
[uD1+=x]:y
0""1=y`
```
This script prints out the maximum file descriptor available from
repeated `dup(2)`s---usually `NOFILE - 1`. Can you see how it works?
@@ -79,9 +84,11 @@ repeated `dup(2)`s---usually `NOFILE - 1`. Can you see how it works?
# [sorta.iecho](sorta.iecho)
```
[" "$ld]:sld [ print a space ]ld
[1s1+DA$ld1s1_+D=sD=x]:xld [ given n (argc-n), print args ]ld
0a1_+D=x""` [ simulation of /bin/echo ]ld
```
This is a clone of `/bin/echo`, minus any argument processing and escape
interpretation. (Note that, unlike some shells' echo, `/bin/echo` prints a
@@ -90,8 +97,9 @@ newline even with no arguments.) Try `./sorta foo bar < iecho`.
# [sorta.ifact1](sorta.ifact1)
```
1#`ld2*#`ld3*#`ld4*#`ld5*#`ld6*#`ld7*#`ld8*#`ld9*#`ld10*#`ld
```
This is a very straightforward factorial program: Take 1, print it,
multiply by 2, print it, multiply by 3, print it, etc.
@@ -99,10 +107,11 @@ multiply by 2, print it, multiply by 3, print it, etc.
# [sorta.ifact2](sorta.ifact2)
```
[1+D2s*#`ld1s]:f
1 0
1=f 1=f 1=f 1=f 1=f 1=f 1=f 1=f 1=f 1=f
```
`ifact1` does a lot of repeated work. `ifact2` takes advantage of this by
keeping the current `n!` `n` on the stack. Each call to routine `f (1=f)`
@@ -111,10 +120,11 @@ increments `n` by `1` and prints out the factorial.
# [sorta.ifact3](sorta.ifact3)
```
[1+D2s*#`ld1s]:f [ given (n-1)! (n-1), print n!, put n! n ]
[2s1=f2s1_+D0>=x]:x [ given n n! x, print (n+1)! through (n+x)! ]
0 1 10 1=x
```
Finally, `ifact3` removes all the redundancy from `ifact2`, and exhibits
proper documentation of stack routines. You can replace the `10` by
@@ -123,16 +133,18 @@ anything in this version.
# [sorta.iio](sorta.iio)
[ a simple example of interpreting code on the fly ]ld
```
[ a simple example of interpreting code on the fly ]ld
["] "2 2+":xT ["]T " produces "T 1=x#T " which should be 4."T`
```
Notice that `"2 2+"` is a literal string inside the program.
# [sorta.irot13](sorta.irot13)
```
"[] [.tr] "
["]".[a-m][n-z][A-M][N-Z]"[" ]TTT ["]".[n-z][a-m][N-Z][A-M]"[" ]TTT
"[tr] !q"T:xld
@@ -142,6 +154,7 @@ Notice that `"2 2+"` is a literal string inside the program.
1A 0 [ that 0 is for RDONLY ]ld
0 'o D0 1s>=hld
0Ou1=x [ in a more complex spawner, this would be done under a fork ]ld
```
Despite its name, `irot13` is meant to show how to exec a program with
redirection from within `sorta`. You run it as `./sorta blah < irot13`; it
@@ -154,21 +167,24 @@ executes the `tr`.
# [sorta.isleep](sorta.isleep)
```
["" "+sleep" "+5" "sleep" !q]:S [F0>1_+=S]:s
"forking sleep 5..."`ld
1=s
"waiting for sleep to finish..."`ld
w
"done, sleep exit code " #T`
```
This script illustrates the classic fork-exec-wait.
# [sorta.itailrec](sorta.itailrec)
```
[3*#" "T$ldD=f]:f
1=f
```
The sole purpose of this script is to prove that `sorta` can do infinite
tail recursion (in this case, in program `f`). Do `./sorta < itailrec | more`
@@ -177,9 +193,11 @@ and watch the powers of 3 (mod your computer's word size) flow by.
# [sorta.iwhosort](sorta.iwhosort)
```
[0Ou "" "+-u" "sort" !q]:S [F0>1_+=S]:s
[1Ou "" "+-u" "who" !q]:W [F0>1_+=W]:w
P1=wO1=sOww
```
This final example is a simple pipeline, `who | sort`.