Expand all leading tabs in markdown files

Given how problematic leading tabs in markdown files can be,
we have expanded all leading tabs in markdown files by:

```sh
find * -type f -name '*.md' -print |
  while read -r file; do
    rm -f "$file.tmp" ;
    expand < "$file" > "$file.tmp" ;
    mv -f -v "$file.tmp" "$file" ;
  done
```

Given the previous changes to `bin/pandoc-wrapper.sh` and other recent
commits and recent pull requests, the were were **NO** changes to
any HTML files.  This is a **good thing** as the expression goes.

No there are no leading tabs in any markdown files.
A check to catch any re-introduction of leading tabs
into any markdown file is on the way.

BTW: We do not have anything against leading tabs in files,
even though we have had to deal with their impact on forming
HTML from markdown files (as well as the calc source code).
It is just that this is one of those cases where tabs conflict
(sometimes caused by people wanting to change the classic
8-space tab model) with a desired outcome.

Perform `make www` to perform the above and test under macOS.
This commit is contained in:
Landon Curt Noll committed 2024-06-24 11:57:35 -07:00
1 parent bf28cac593
commit 7712db4a17
117 files changed
+1758 -1758

No files matched your search

+9 -9
View File
@@ -104,16 +104,16 @@ A CGI script such as:
${ECHO} "Content-type: text/html"
${ECHO}
if [ -z "${QUERY_STRING}" ]; then
${ECHO} "QUERY_STRING not found"
${ECHO} "QUERY_STRING not found"
else
URL=`${EXPR} "$QUERY_STRING" : '[Uu][Rr][Ll]=\(.*\)'`
if [ -z "${URL}" ]; then
${ECHO} "No URL given in QUERY_STRING"
elif [ X`${EXPR} "${URL}" : '[Ff][Ii][Ll][Ee]:'` != X0 ]; then
${ECHO} "file: based URLs are not allowed"
else
${LYNX} -restrictions=all -source "${URL}" | ${POOT}
fi
URL=`${EXPR} "$QUERY_STRING" : '[Uu][Rr][Ll]=\(.*\)'`
if [ -z "${URL}" ]; then
${ECHO} "No URL given in QUERY_STRING"
elif [ X`${EXPR} "${URL}" : '[Ff][Ii][Ll][Ee]:'` != X0 ]; then
${ECHO} "file: based URLs are not allowed"
else
${LYNX} -restrictions=all -source "${URL}" | ${POOT}
fi
fi
```
+21 -21
View File
@@ -45,8 +45,8 @@ counter before shifting out each symbol, such as
``` <!---c-->
length = (encoding & 96) >> 5;
do {
putchar(encoding & 1 ? '-' : '.');
encoding >>= 1;
putchar(encoding & 1 ? '-' : '.');
encoding >>= 1;
} while (length--);
```
@@ -64,8 +64,8 @@ with 1 bit still to be chosen freely (let's assume it is 0). Now we can do
``` <!---c-->
do {
putchar(encoding & 1 ? '-' : '.');
encoding >>= 1;
putchar(encoding & 1 ? '-' : '.');
encoding >>= 1;
while (encoding > 1);
```
@@ -89,8 +89,8 @@ is encoded still allows the encoding to be its own counter:
``` <!---c-->
do {
putchar(encoding & 1 ? '-' : '.');
encoding = (encoding + 32) >> 1;
putchar(encoding & 1 ? '-' : '.');
encoding = (encoding + 32) >> 1;
} while (encoding > 35);
```
@@ -145,21 +145,21 @@ The outline of the program is roughly as follows
```
while (more lines) {
if (line is in morse) {
while (more characters) {
skip next sequence
if (' ')
putchar(' ');
else
decode_sequence; /* backwards */
}
} else {
while (more characters) {
if (isalnum)
encode_character;
putchar(' ');
}
}
if (line is in morse) {
while (more characters) {
skip next sequence
if (' ')
putchar(' ');
else
decode_sequence; /* backwards */
}
} else {
while (more characters) {
if (isalnum)
encode_character;
putchar(' ');
}
}
```
Because of the *two* `while(more characters)` loops are the same, I've
+39 -39
View File
@@ -92,10 +92,10 @@ has the value `a`. Another function called `K` is defined as `\x\y(x)`
and it evaluates as follows:
```
K p q
-> \x\y(x) p q
-> \y(p) q
-> p
K p q
-> \x\y(x) p q
-> \y(p) q
-> p
```
Another function of interest is `S`, defined as `\f\g\x((f x) (g x))`.
@@ -106,15 +106,15 @@ variables or lambda abstractions. In fact, even `I` is unnecessary,
since it is equivalent to `S K K`:
```
I z
-> \a(a) z
-> z
I z
-> \a(a) z
-> z
S K K z
-> \f\g\x((f x) (g x)) K K z
-> (K z) (K z)
-> \x\y(x) z (K z)
-> z
S K K z
-> \f\g\x((f x) (g x)) K K z
-> (K z) (K z)
-> \x\y(x) z (K z)
-> z
```
The algorithm for translating lambda expressions into combinator
@@ -122,9 +122,9 @@ expressions works as follows. There are three forms of lambda expression
to consider: variables, applications, and abstractions.
```
trans v -> v (variable)
trans a b -> (trans a) (trans b ) (application)
trans \ab -> abs a (trans b) (abstraction)
trans v -> v (variable)
trans a b -> (trans a) (trans b ) (application)
trans \ab -> abs a (trans b) (abstraction)
```
There are a further three cases to consider for the body of lambda
@@ -132,33 +132,33 @@ expressions, where we need to do the magic that transforms away the
variables.
```
abs a f x -> S (abs a f) (abs a x)
abs a b -> K b (b != a)
abs a a -> I
abs a f x -> S (abs a f) (abs a x)
abs a b -> K b (b != a)
abs a a -> I
```
E.g. suppose we had combinator expressions for `+` and `3` and we wanted
to see what the combinator expression for doubling 3 looked like:
```
trans \x(+ x x) 3
-> (trans \x(+ x x)) (trans 3)
-> (abs x (trans + x x)) 3
-> (abs x + x x) 3
-> S (abs x + x) (abs x x) 3
-> S (S (abs x +) (abs x x)) I 3
-> S (S (K +) I) I 3
-> S (S (K +) I) I 3
trans \x(+ x x) 3
-> (trans \x(+ x x)) (trans 3)
-> (abs x (trans + x x)) 3
-> (abs x + x x) 3
-> S (abs x + x) (abs x x) 3
-> S (S (abs x +) (abs x x)) I 3
-> S (S (K +) I) I 3
-> S (S (K +) I) I 3
```
We can then check that this evaluates to the expected result:
```
S (S (K +) I) I 3
-> S (K +) I 3 (I 3)
-> K + 3 (I 3) (I 3)
-> + (I 3) (I 3)
-> + 3 3
S (S (K +) I) I 3
-> S (K +) I 3 (I 3)
-> K + 3 (I 3) (I 3)
-> + (I 3) (I 3)
-> + 3 3
```
It is possible to perform a slightly more compact translation with a
@@ -166,24 +166,24 @@ couple of simple optimisations. For example, note that `K (a b)` is the
same as `S (K a) (K b)`, because
```
K (a b) x
-> a b
K (a b) x
-> a b
```
and
```
S (K a) (K b) x
-> K a x (K b x)
-> a b
S (K a) (K b) x
-> K a x (K b x)
-> a b
```
Also, `S (K a) I` is the same as just `a` because
```
S (K a) I x
-> K a x (I x)
-> a x
S (K a) I x
-> K a x (I x)
-> a x
```
The program simply reads a lambda expression from the standard input,
+1 -1
View File
@@ -53,7 +53,7 @@ Shortly below that you will see, as noted above, the numbers:
``` <!---c-->
if ((H = fopen (__FILE__+43, 43+__FILE__)))
while ((fgets (L, (int)sizeof L, H)) != 0) {
I[strcspn (I, 45+__FILE__)] = O = 0;
I[strcspn (I, 45+__FILE__)] = O = 0;
```
The first number in the above C means the length starting from 0 up through the
+1 -1
View File
@@ -51,7 +51,7 @@ often produced an error of the form:
``` <!---sh-->
gcc -ansi schweikh2.alt.c -o schweikh2.alt
as: Error: cca00NzV.s, line 58: Missing " at end of string
"
"
as: Error: cca00NzV.s, line 58: malformed statement
*** Error code 1 (bu21)
```
+8 -8
View File
@@ -113,14 +113,14 @@ following meanings:
A = argv
b = array of unsigned long variables
b[0] = bit-width of the CRC (argv[2])
b[1] = CRC polynomial (argv[3])
b[2] = nonzero if CRC is reflected (argv[4])
b[3] = initial value of CRC (argv[5])
b[4] = value final CRC is XORed with (argv[6])
b[5] = CRC value
b[6] = byte from file
b[7] = counter
b[0] = bit-width of the CRC (argv[2])
b[1] = CRC polynomial (argv[3])
b[2] = nonzero if CRC is reflected (argv[4])
b[3] = initial value of CRC (argv[5])
b[4] = value final CRC is XORed with (argv[6])
b[5] = CRC value
b[6] = byte from file
b[7] = counter
B = FILE * through which the file argv[1] is opened