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

+2 -2
View File
@@ -23,9 +23,9 @@ For more detailed information see [2018/algmyr in bugs.html](../../bugs.html#201
## To use:
``` <!---sh-->
./prog < prog.c # Print garbage: might mess up your terminal
./prog < prog.c # Print garbage: might mess up your terminal
./prog <file1> <file2> > out.raw
./prog -d 2 0 out.raw # Decode the first (0th) channel out of two
./prog -d 2 0 out.raw # Decode the first (0th) channel out of two
```
+1 -1
View File
@@ -83,7 +83,7 @@ E.g:
``` <!---c-->
main(){system("hd");} // it's turtles all the way down!
main(){system("hd");} // it's turtles all the way down!
```
is not acceptable.
+21 -21
View File
@@ -137,7 +137,7 @@ The discrepancies found are documented and explained in the file
``` <!---sh-->
find ~/src/obc -type f -a -name "*.c" | xargs ./spotcheck.sh ./prog | ./spotdiff.sh |
grep -v keep | diff -bw - discrep* | grep "[<>] cl "
grep -v keep | diff -bw - discrep* | grep "[<>] cl "
```
In summary, there are only 6 unique entries out of 366 that have any variation
@@ -228,38 +228,38 @@ language_. It really is this easy with `tac`:
#!/usr/bin/env bash
script='
BEGIN {
last=nl="\n";
f="c11"; while(getline <f > 0) kw[$0]++; close(f);
last=nl="\n";
f="c11"; while(getline <f > 0) kw[$0]++; close(f);
}
function iskw(a) { return a in kw }
function indent(a) { return sprintf("%*s", n*3, " ") }
function newline() { if (!infor && last != nl) printf last=nl; }
function show(a) {
if (last==nl) printf "%s", indent()
printf "%s%s", space(), a
last=a
if (last==nl) printf "%s", indent()
printf "%s%s", space(), a
last=a
}
function space() {
return iskw(last) ||
(last ~ /[A-Za-z0-9_+-\/%^[&\]\)=:<>;]$/ && $0 !~ /[:;()\[\],]/) ? " " : ""
return iskw(last) ||
(last ~ /[A-Za-z0-9_+-\/%^[&\]\)=:<>;]$/ && $0 !~ /[:;()\[\],]/) ? " " : ""
}
/^\(/ { ++paren }
/^\)/ { --paren }
/^\(/ { ++paren }
/^\)/ { --paren }
/^for/ { newline(); infor=1 }
infor && /^;/ { ++infor; show($0 " "); next }
/^for/ { newline(); infor=1 }
infor && /^;/ { ++infor; show($0 " "); next }
infor==1 && /^:/ { ++infor }
infor>1 && paren==0 { infor=0 }
/^\?/ { tern++; n++; newline(); show($0 " "); next }
tern && /^:/ { newline(); show($0); --tern; --n; next }
/^\?/ { tern++; n++; newline(); show($0 " "); next }
tern && /^:/ { newline(); show($0); --tern; --n; next }
/^#/ { newline(); show($0); newline(); next }
/^;/ { show($0); newline(); next }
/^{/ { show($0); ++n; newline(); next }
/^}/ { n--; newline(); show($0); newline(); next }
/^#/ { newline(); show($0); newline(); next }
/^;/ { show($0); newline(); next }
/^{/ { show($0); ++n; newline(); next }
/^}/ { n--; newline(); show($0); newline(); next }
{ show($0) }
'
@@ -329,9 +329,9 @@ The following reserved word files are included:
* [kandr](%%REPO_URL%%/2018/burton2/kandr) from my venerable 1978 18th printing "The C Programming Language"
* [v7unix](%%REPO_URL%%/2018/burton2/v7unix) 7th edition Unix source code, extracted from c00.c
* [kandr2](%%REPO_URL%%/2018/burton2/kandr2) from my 1988 1st printing "The C Programming Language", 2e
* [ansi](%%REPO_URL%%/2018/burton2/ansi) ANSI X3.159-1989
* [c99](%%REPO_URL%%/2018/burton2/c99) ISO/IEC 9899:1999(E)
* [c11](%%REPO_URL%%/2018/burton2/c11) ISO/IEC 9899:201x(E) N1570
* [ansi](%%REPO_URL%%/2018/burton2/ansi) ANSI X3.159-1989
* [c99](%%REPO_URL%%/2018/burton2/c99) ISO/IEC 9899:1999(E)
* [c11](%%REPO_URL%%/2018/burton2/c11) ISO/IEC 9899:201x(E) N1570
* [c++98](%%REPO_URL%%/2018/burton2/c++98) http://en.cppreference.com/w/cpp/keyword
* [c++11](%%REPO_URL%%/2018/burton2/c++11) ISO/IEC 14882:2011(E) N3337 2012-01-16
* [c++14](%%REPO_URL%%/2018/burton2/c++14) ISO/IEC 14882:2014(E) N4296 2014-11-09
+14 -14
View File
@@ -59,20 +59,20 @@ different"](https://en.wikipedia.org/wiki/And_Now_for_Something_Completely_Diffe
is also used in the opening.
```
___-----__
_-- --__
_- _--_ \
_- /\ +-.:.:-+ /\ \
/ \/ |.:.:.:| \/ |
/ |:.:.:.| |
/ |.:.:.:| | ___-----___
| |.:.:| | / \
| |:.:.| | < It's ... |
\ |:.| | \ /
\ || | ---_____---
_--\ |
_- -__ |
__- --___ |
___-----__
_-- --__
_- _--_ \
_- /\ +-.:.:-+ /\ \
/ \/ |.:.:.:| \/ |
/ |:.:.:.| |
/ |.:.:.:| | ___-----___
| |.:.:| | / \
| |:.:.| | < It's ... |
\ |:.| | \ /
\ || | ---_____---
_--\ |
_- -__ |
__- --___ |
_- |
/ |
| |
+12 -12
View File
@@ -3,9 +3,9 @@
- [prog.c](prog.c)
* This is the source file to the `weasel` program [1].
- [prog.alt.c](prog.alt.c)
* This is the source code file to the `weasel.alt` program [1].
* This is the source code file to the `weasel.alt` program [1].
- [test.sh](test.sh)
* Script provided to test the weasel program [1].
* Script provided to test the weasel program [1].
- [test-strings.txt](test-strings.txt)
* The `test.sh` script reads from this file and runs the program with these
target strings.
@@ -47,18 +47,18 @@ remarks I have kept it in place. Please note that the paths below are dependent
on the prefix used in installation; where I suggest `/usr` it is equally
possible it could be under '/usr/local', for example.
[1] Note that [prog.c](prog.c) and
[prog.alt.c](prog.alt.c) would be
linked to `weasel.c` and `weasel.alt.c`
(respectively) in the `/usr/src/weasel`
subdirectory.
[1] Note that [prog.c](prog.c) and
[prog.alt.c](prog.alt.c) would be
linked to `weasel.c` and `weasel.alt.c`
(respectively) in the `/usr/src/weasel`
subdirectory.
[2] The file would most likely be compressed as
`weasel.1.gz` under the `/usr/share/man/man1`
subdirectory.
[2] The file would most likely be compressed as
`weasel.1.gz` under the `/usr/share/man/man1`
subdirectory.
[3] These files would be in the `/usr/share/doc/weasel`
subdirectory.
[3] These files would be in the `/usr/share/doc/weasel`
subdirectory.
<hr style="width:10%;text-align:left;margin-left:0">
+2 -2
View File
@@ -372,11 +372,11 @@ precise the following characters are acceptable; it equates to this in C (note
it includes a literal space `' '` but it doesn't include other
`isspace()` characters) and this is why some of the characters are escaped:
const char keyboard[]=" !\"#$<%:>&'()*+,-./0123456789;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`{|}~";
const char keyboard[]=" !\"#$<%:>&'()*+,-./0123456789;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`{|}~";
The simpler keyboard looks like:
const char keyboard[]=" !\"&'(),.0123456789;?ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const char keyboard[]=" !\"&'(),.0123456789;?ABCDEFGHIJKLMNOPQRSTUVWXYZ";
The program makes sure that the target string only has characters the keyboard
can actually produce but there is a certain type of input error that might
+1 -1
View File
@@ -311,7 +311,7 @@ Assuming you're more careful than that, we can try a few commands:
# cat > foo.c
main()
{
printf("Hello, World!\n");
printf("Hello, World!\n");
}
^D
# cc foo.c