improved indentation and whitespace for markdown code blocks

All code blocks in markdown have been intended by at least 4 spaces.

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 from "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`.

Fixed excess whitespace after list Author on entry `index.html` page.

Changed `bin/output-index-author.sh` VERSION from "1.5.2 2024-03-26"
to "1.6 2024-03-31".

Performed `make www` to perform the above and test under macOS.

TODO: Fix the problem of the initial line of code being extra intended.
TODO: Fix excess whitespace around code that is inline.
This commit is contained in:
Landon Curt Noll committed 2024-04-01 04:48:48 -07:00
1 parent b84c27ce02
commit a996f8d2b8
734 files changed
+16723 -16963

No files matched your search

+11 -11
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
@@ -10,8 +10,8 @@ make all
The current status of this entry is:
```
STATUS: missing file - please provide it
STATUS: INABIAF - please **DO NOT** fix
STATUS: missing file - please provide it
STATUS: INABIAF - please **DO NOT** fix
```
For more detailed information see [1994 shapiro bugs](../../bugs.html#1994_shapiro).
@@ -20,7 +20,7 @@ For more detailed information see [1994 shapiro bugs](../../bugs.html#1994_shapi
## To use:
```sh
./shapiro &
./shapiro &
```
Now find the clock in the same terminal window (or console if at the console).
@@ -29,14 +29,14 @@ Now find the clock in the same terminal window (or console if at the console).
## Try:
```sh
./shapiro
^Z
bg
ps x
fg
^C
./shapiro
^Z
bg
ps x
fg
^C
./shapiro_t1
./shapiro_t1
```
Notice what you see in the output of `ps`! Observe too what happens after you
+12 -13
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Andrew_Shapiro">Andrew T. Shapiro</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,24 +141,24 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> all</span></code></pre></div>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: missing file - please provide it
STATUS: INABIAF - please **DO NOT** fix</code></pre>
<pre><code> STATUS: missing file - please provide it
STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#1994_shapiro">1994 shapiro bugs</a>.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./shapiro</span> <span class="kw">&amp;</span></span></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./shapiro</span> <span class="kw">&amp;</span></span></code></pre></div>
<p>Now find the clock in the same terminal window (or console if at the console).</p>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./shapiro</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">^Z</span></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="bu">bg</span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a><span class="fu">ps</span> x</span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a><span class="bu">fg</span></span>
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a><span class="ex">^C</span></span>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./shapiro</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">^Z</span></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="bu">bg</span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">ps</span> x</span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> <span class="bu">fg</span></span>
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a> <span class="ex">^C</span></span>
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a><span class="ex">./shapiro_t1</span></span></code></pre></div>
<span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a> <span class="ex">./shapiro_t1</span></span></code></pre></div>
<p>Notice what you see in the output of <code>ps</code>! Observe too what happens after you
bring it back to the foreground.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
+44 -45
View File
@@ -125,18 +125,18 @@
<h1 id="hints">HINTS</h1>
<p>For the first program (<a href="shapiro.c">shapiro.c</a>):</p>
<p>This is a very simple program:</p>
<pre><code> 1. #include &lt;stdio.h&gt;
2. main()
3. {
4. int K,L,M=0;
5. FILE *J;
6. J=fopen(__FILE__,&quot;r&quot;);
7. for(;
8. (L=getc(J))&gt;=0;
9. L&gt;=&#39;J&#39;&amp;&amp;L&lt;=&#39;J&#39;+15 &amp;&amp;
10. ((M=!M)?K=L:putchar(K-&#39;J&#39;|(L-&#39;J&#39;&lt;&lt;4)))
11. );
12. exit(0);}</code></pre>
<pre><code> 1. #include &lt;stdio.h&gt;
2. main()
3. {
4. int K,L,M=0;
5. FILE *J;
6. J=fopen(__FILE__,&quot;r&quot;);
7. for(;
8. (L=getc(J))&gt;=0;
9. L&gt;=&#39;J&#39;&amp;&amp;L&lt;=&#39;J&#39;+15 &amp;&amp;
10. ((M=!M)?K=L:putchar(K-&#39;J&#39;|(L-&#39;J&#39;&lt;&lt;4)))
11. );
12. exit(0);}</code></pre>
<p>Lines 1-5 are basic stuff. Line 6 opens the source code for input. Line 7 is the
loop. Line 8 reads in each character in the file (placed in <code>L</code>) while not &gt;= 0.
Line 9 is an <code>if</code> expression which filters out all characters not between <code>J</code>
@@ -152,35 +152,34 @@ contiguous ASCII characters free for the encoding. Because of this the
second program is mostly included as a comment. However, some of the
characters of the encoded program are also source code for the decoder.</p>
<h3 id="for-the-second-program-with-time.h">For the second program (with time.h):</h3>
<pre><code> 1 #include &lt;stdio.h&gt;
2 #include &lt;time.h&gt;
3 #define o(j,k,m,n,l) {fprintf(j,a[k],m,n,a[l]);fflush(j);}
4 char *a[]={&quot;%c+------------+\n&quot;,&quot;%c+%3d %-8s+\n&quot;,&quot;seconds&quot;,&quot;minutes&quot;,
5 &quot;hours&quot;,&quot;%s\n&quot;,&quot;\0337\033[%d;65;H%s\0338&quot;};
6 int b[]={0,0,17,14,11,0};
7 main(v,c)
8 int v;
9 char ** c;
10 {
11 char d[40],*e,f=6;
12 time_t g;
13 FILE *h,*i;
14 while (--f &amp;&amp; !pipe(d) &amp;&amp; !fork());
15 h=fdopen(6-f&lt;&lt;1,&quot;a&quot;);
16 i=fdopen((6-f&lt;&lt;1)+1,&quot;r&quot;);
17 for(;;){
18 if(f){
19 fgets(d,40,i);
20 d[strlen(d)-1]=&#39;\0&#39;;
21 if(*d==&#39;0&#39;+f){ sprintf(*c,&quot;%s\n&quot;,d+1); o(stdout,6,6-f,d+1,0) }
22 if(*d&gt;&#39;0&#39;+f) o(h,5,d,0,0)
23 }else{
24 time(&amp;g);
25 e=asctime(localtime(&amp;g));
26 for(v=1;v&lt;6;v++) o(h,v!=1&amp;&amp;v!=6-1,v+&#39;0&#39;,atoi(e+b[v]),v)
27 sleep(1);
28 }}}
</code></pre>
<pre><code> 1 #include &lt;stdio.h&gt;
2 #include &lt;time.h&gt;
3 #define o(j,k,m,n,l) {fprintf(j,a[k],m,n,a[l]);fflush(j);}
4 char *a[]={&quot;%c+------------+\n&quot;,&quot;%c+%3d %-8s+\n&quot;,&quot;seconds&quot;,&quot;minutes&quot;,
5 &quot;hours&quot;,&quot;%s\n&quot;,&quot;\0337\033[%d;65;H%s\0338&quot;};
6 int b[]={0,0,17,14,11,0};
7 main(v,c)
8 int v;
9 char ** c;
10 {
11 char d[40],*e,f=6;
12 time_t g;
13 FILE *h,*i;
14 while (--f &amp;&amp; !pipe(d) &amp;&amp; !fork());
15 h=fdopen(6-f&lt;&lt;1,&quot;a&quot;);
16 i=fdopen((6-f&lt;&lt;1)+1,&quot;r&quot;);
17 for(;;){
18 if(f){
19 fgets(d,40,i);
20 d[strlen(d)-1]=&#39;\0&#39;;
21 if(*d==&#39;0&#39;+f){ sprintf(*c,&quot;%s\n&quot;,d+1); o(stdout,6,6-f,d+1,0) }
22 if(*d&gt;&#39;0&#39;+f) o(h,5,d,0,0)
23 }else{
24 time(&amp;g);
25 e=asctime(localtime(&amp;g));
26 for(v=1;v&lt;6;v++) o(h,v!=1&amp;&amp;v!=6-1,v+&#39;0&#39;,atoi(e+b[v]),v)
27 sleep(1);
28 }}}</code></pre>
<p>Lines 1 and 2 have to be there. Think of <code>o</code> in line 3 as send message with
<code>j</code>,<code>k</code> and <code>m</code> as where, format and what. Lines 4 and 5 are all the text
strings. Line 6 is the offsets into the time string for the hours, minutes and
@@ -206,10 +205,10 @@ to the string we just put there.</li>
(<code>"\0337\033[%d;65;H%s\0338"</code>) If you can read VTxxx (and I read books printed
as ANSI/VTxxx codes for fun :-) ) you know this is the sequence for:</li>
</ol>
<pre><code>remember where we are,
go somewhere else,
print the message,
and return to where we started.</code></pre>
<pre><code> remember where we are,
go somewhere else,
print the message,
and return to where we started.</code></pre>
<p>Line 22 says if this message is not for us (the number is bigger than ours)
send it to <code>h</code> (up).</p>
<p>Lines 24 to 27 are the master code. Here we get the time and convert it
+44 -45
View File
@@ -6,18 +6,18 @@ For the first program ([shapiro.c](shapiro.c)):
This is a very simple program:
```
1. #include <stdio.h>
2. main()
3. {
4. int K,L,M=0;
5. FILE *J;
6. J=fopen(__FILE__,"r");
7. for(;
8. (L=getc(J))>=0;
9. L>='J'&&L<='J'+15 &&
10. ((M=!M)?K=L:putchar(K-'J'|(L-'J'<<4)))
11. );
12. exit(0);}
1. #include <stdio.h>
2. main()
3. {
4. int K,L,M=0;
5. FILE *J;
6. J=fopen(__FILE__,"r");
7. for(;
8. (L=getc(J))>=0;
9. L>='J'&&L<='J'+15 &&
10. ((M=!M)?K=L:putchar(K-'J'|(L-'J'<<4)))
11. );
12. exit(0);}
```
Lines 1-5 are basic stuff. Line 6 opens the source code for input. Line 7 is the
@@ -41,35 +41,34 @@ characters of the encoded program are also source code for the decoder.
### For the second program (with time.h):
```
1 #include <stdio.h>
2 #include <time.h>
3 #define o(j,k,m,n,l) {fprintf(j,a[k],m,n,a[l]);fflush(j);}
4 char *a[]={"%c+------------+\n","%c+%3d %-8s+\n","seconds","minutes",
5 "hours","%s\n","\0337\033[%d;65;H%s\0338"};
6 int b[]={0,0,17,14,11,0};
7 main(v,c)
8 int v;
9 char ** c;
10 {
11 char d[40],*e,f=6;
12 time_t g;
13 FILE *h,*i;
14 while (--f && !pipe(d) && !fork());
15 h=fdopen(6-f<<1,"a");
16 i=fdopen((6-f<<1)+1,"r");
17 for(;;){
18 if(f){
19 fgets(d,40,i);
20 d[strlen(d)-1]='\0';
21 if(*d=='0'+f){ sprintf(*c,"%s\n",d+1); o(stdout,6,6-f,d+1,0) }
22 if(*d>'0'+f) o(h,5,d,0,0)
23 }else{
24 time(&g);
25 e=asctime(localtime(&g));
26 for(v=1;v<6;v++) o(h,v!=1&&v!=6-1,v+'0',atoi(e+b[v]),v)
27 sleep(1);
28 }}}
1 #include <stdio.h>
2 #include <time.h>
3 #define o(j,k,m,n,l) {fprintf(j,a[k],m,n,a[l]);fflush(j);}
4 char *a[]={"%c+------------+\n","%c+%3d %-8s+\n","seconds","minutes",
5 "hours","%s\n","\0337\033[%d;65;H%s\0338"};
6 int b[]={0,0,17,14,11,0};
7 main(v,c)
8 int v;
9 char ** c;
10 {
11 char d[40],*e,f=6;
12 time_t g;
13 FILE *h,*i;
14 while (--f && !pipe(d) && !fork());
15 h=fdopen(6-f<<1,"a");
16 i=fdopen((6-f<<1)+1,"r");
17 for(;;){
18 if(f){
19 fgets(d,40,i);
20 d[strlen(d)-1]='\0';
21 if(*d=='0'+f){ sprintf(*c,"%s\n",d+1); o(stdout,6,6-f,d+1,0) }
22 if(*d>'0'+f) o(h,5,d,0,0)
23 }else{
24 time(&g);
25 e=asctime(localtime(&g));
26 for(v=1;v<6;v++) o(h,v!=1&&v!=6-1,v+'0',atoi(e+b[v]),v)
27 sleep(1);
28 }}}
```
Lines 1 and 2 have to be there. Think of `o` in line 3 as send message with
@@ -99,10 +98,10 @@ to the string we just put there.
as ANSI/VTxxx codes for fun :-) ) you know this is the sequence for:
```
remember where we are,
go somewhere else,
print the message,
and return to where we started.
remember where we are,
go somewhere else,
print the message,
and return to where we started.
```
Line 22 says if this message is not for us (the number is bigger than ours)