format headers

We move `tmp/format-headers.sh` into `bin/format-headers.sh`.

We also add a few missing empty lines to `README.md`.

We add `bin/format-headers.sh` to the `bin/README.md`.

We run `bin/format-headers.sh` to perform the above.

Performed `make www` to accomplish the above and to test under macOS.
This commit is contained in:
Landon Curt Noll committed 2024-07-19 00:18:41 -07:00
1 parent 0ae673c24e
commit ed866b45e8
28 files changed
+90 -35

No files matched your search

-1
View File
@@ -14,7 +14,6 @@ The current status of this entry is:
For more detailed information see [1984/laman in bugs.html](../../bugs.html#1984_laman).
## To use:
``` <!---sh-->
-1
View File
@@ -36,7 +36,6 @@ The [sicherman.alt.c](%%REPO_URL%%/1985/sicherman/sicherman.alt.c) is a slight c
### Alternate build:
``` <!---sh-->
make alt
```
+1
View File
@@ -27,6 +27,7 @@ supports the `-traditional-cpp` option.
make alt
```
### Alternate use:
Use `wall.alt` as you would `wall` above.
+1
View File
@@ -37,6 +37,7 @@ It has no error recovery, and performs rather poorly in a number of cases. Even
so, placing all this functionality in such a small, densely packed program, is
impressive enough to win the `Best of Show` award.
## Author's remarks:
This program implements a Lisp interpreter in 1465 bytes of source.
+1
View File
@@ -4,6 +4,7 @@
make all
```
### Bugs and (Mis)features:
The current status of this entry is:
-1
View File
@@ -18,7 +18,6 @@ The current status of this entry is:
For more detailed information see [1990/westley in bugs.html](../../bugs.html#1990_westley).
## To use:
``` <!---sh-->
-2
View File
@@ -53,10 +53,8 @@ If you get stuck, come back and read the author's remarks for additional hints
and information.
## Author's remarks:
The author wishes to thank J Greely for the last 6 bytes.
Here's about how it does it:
+2 -2
View File
@@ -33,14 +33,14 @@ This version, [ant.alt.c](%%REPO_URL%%/1992/ant/ant.alt.c), was provided by the
author in 2024, and is an unobfuscated version.
## Alternate build:
### Alternate build:
``` <!---sh-->
make alt
```
## Alternate use:
### Alternate use:
Use `ant.alt` as you would `ant` above.
+2 -2
View File
@@ -421,9 +421,9 @@ code</a> below.</p>
<h2 id="alternate-code">Alternate code:</h2>
<p>This version, <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1992/ant/ant.alt.c">ant.alt.c</a>, was provided by the
author in 2024, and is an unobfuscated version.</p>
<h2 id="alternate-build">Alternate build:</h2>
<h3 id="alternate-build">Alternate build:</h3>
<pre><code> make alt</code></pre>
<h2 id="alternate-use">Alternate use:</h2>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>ant.alt</code> as you would <code>ant</code> above.</p>
<h2 id="try-1">Try:</h2>
<pre><code> ./try.alt.sh</code></pre>
+3 -3
View File
@@ -39,7 +39,7 @@ unobfuscated version provided by the author. You can look at this code if you
want some clues in how it works.
## Alternate build:
### Alternate build:
If you wish to build this deobfuscated version, you can do so like:
@@ -49,12 +49,12 @@ If you wish to build this deobfuscated version, you can do so like:
```
## Alternate use:
### Alternate use:
Use `ant.alt` like you would `ant` above.
## Alternate try:
### Alternate try:
``` <!---sh-->
./try.alt.sh
+3 -3
View File
@@ -426,12 +426,12 @@ code</a> below.</p>
<p>The <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1993/ant/ant.alt.c">ant.alt.c</a> is an
unobfuscated version provided by the author. You can look at this code if you
want some clues in how it works.</p>
<h2 id="alternate-build">Alternate build:</h2>
<h3 id="alternate-build">Alternate build:</h3>
<p>If you wish to build this deobfuscated version, you can do so like:</p>
<pre><code> make alt</code></pre>
<h2 id="alternate-use">Alternate use:</h2>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>ant.alt</code> like you would <code>ant</code> above.</p>
<h2 id="alternate-try">Alternate try:</h2>
<h3 id="alternate-try">Alternate try:</h3>
<pre><code> ./try.alt.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>See the author’s POSIX P1003.2-like documentation file <a href="ant.txt">ant.txt</a> for
-1
View File
@@ -37,7 +37,6 @@ Mode may be a value from 0 to 12.
## Alternate code:
### NOTICE to those who wish for a greater challenge:
**If you want a greater challenge, don't read any further**:
-2
View File
@@ -14,8 +14,6 @@ The current status of this entry is:
For more detailed information see [2001/cheong in bugs.html](../../bugs.html#2001_cheong).
## To use:
``` <!---sh-->
-1
View File
@@ -14,7 +14,6 @@ The current status of this entry is:
For more detailed information see [2001/ollinger in bugs.html](../../bugs.html#2001_ollinger).
## To use:
``` <!---sh-->
-1
View File
@@ -46,7 +46,6 @@ This will run the `configure` script and then compile and link in (in
Then with your browser do the same as for the original source.
## Judges' remarks:
This entry violates the [guidelines](../../2004/guidelines.txt) in so many ways! We
-2
View File
@@ -14,8 +14,6 @@ The current status of this entry is:
For more detailed information see [2006/hamre in bugs.html](../../bugs.html#2006_hamre).
## To use:
``` <!---sh-->
-1
View File
@@ -14,7 +14,6 @@ The current status of this entry is:
For more detailed information see [2006/stewart in bugs.html](../../bugs.html#2006_stewart).
## To use:
``` <!---sh-->
-1
View File
@@ -14,7 +14,6 @@ The current status of this entry is:
For more detailed information see [2011/konno in bugs.html](../../bugs.html#2011_konno).
## To use:
``` <!---sh-->
+1 -1
View File
@@ -18,7 +18,7 @@ Windows](%%REPO_URL%%/2011/toledo/toledo.alt2.c). See [Alternate code](#alternat
```
## Alternate code
## Alternate code:
The first alt version, [toledo.alt.c](%%REPO_URL%%/2011/toledo/toledo.alt.c), allows you to reconfigure
the controls and the dimensions more easily.
+1 -1
View File
@@ -415,7 +415,7 @@ controls and size</a> and <a href="https://github.com/ioccc-src/temp-test-ioccc/
Windows</a>. See <a href="#alternate-code">Alternate code</a> below.</p>
<h2 id="to-use">To use:</h2>
<pre><code> ./toledo</code></pre>
<h2 id="alternate-code">Alternate code</h2>
<h2 id="alternate-code">Alternate code:</h2>
<p>The first alt version, <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/toledo/toledo.alt.c">toledo.alt.c</a>, allows you to reconfigure
the controls and the dimensions more easily.</p>
<p>The second version, <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/toledo/toledo.alt2.c">toledo.alt2.c</a>, should work for Windows but
-2
View File
@@ -75,8 +75,6 @@ even needing to create a temporary file but as the author refers to it and its
uses it can still be generated to follow along.
## Author's remarks:
### Using hou
-1
View File
@@ -17,7 +17,6 @@ The current status of this entry is:
For more detailed information see [2015/howe in bugs.html](../../bugs.html#2015_howe).
## To use:
``` <!---sh-->
+1 -1
View File
@@ -53,7 +53,7 @@ with the MIDI "SMF" file format.
entry](https://www.nathanotterness.com/2021/04/obfuscated_c_2020.html).
## Alternate use:
### Alternate use:
Use `prog.alt` as you would `prog`.
+1 -1
View File
@@ -437,7 +437,7 @@ with the MIDI “SMF” file format.</p>
</blockquote>
<p>… at their <a href="https://www.nathanotterness.com/2021/04/obfuscated_c_2020.html">web page about the
entry</a>.</p>
<h2 id="alternate-use">Alternate use:</h2>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>prog.alt</code> as you would <code>prog</code>.</p>
<h3 id="alternate-try">Alternate try:</h3>
<pre><code> ./try.alt.sh</code></pre>
+3
View File
@@ -22,6 +22,7 @@ temp-test-ioccc GitHub repo.
<!-- XXX - remove down to here in the final stages of the Great Fork Merge -->
# The International Obfuscated C Code Contest
## **Obfuscate** | *verb* [with object]
- render obscure, unclear, or unintelligible: the spelling changes will deform
@@ -33,6 +34,7 @@ obfuscatory | adjective
late Middle English (as adjective): from late Latin **obfuscat-**
'darkened', from the verb **obfuscare**, based on Latin **fuscus** 'dark'.
## **Obfuscation** | *noun*
- the action of making something obscure, unclear, or unintelligible: when
@@ -44,6 +46,7 @@ mealy-mouthed denials and obfuscations.
The official IOCCC website is [www.ioccc.org](https://www.ioccc.org).
## How it was started:
The original inspiration of the International Obfuscated C Code Contest came
+33 -1
View File
@@ -49,6 +49,7 @@ to set the verbosity level to `3`. The default for verbosity is `0`, no
verbosity, though using the [top level Makefile](%%REPO_URL%%/Makefile) will,
for some tools, set a verbosity level.
### Get version string of a tool
If you just want to know what version the tool is, you can use the `-V` option.
@@ -111,6 +112,7 @@ Or for example:
bin/all-years.sh -v 1 bin/chk-entry.sh
```
<div id="chk-entry">
### [chk-entry.sh](%%REPO_URL%%/bin/chk-entry.sh)
</div>
@@ -131,6 +133,7 @@ the top level `Makefile` by:
make verify_entry_files
```
<div id="filelist-entry-json-awk">
### [filelist.entry.json.awk](%%REPO_URL%%/bin/filelist.entry.json.awk)
</div>
@@ -186,6 +189,20 @@ We recommend that this tool be invoked via the top level `Makefile` by:
make find_missing_links
```
<div id="format-headers">
### [format-headers.sh](%%REPO_URL%%/bin/format-headers.sh)
</div>
Format select headers and preceding empty lines in entry README.md files.
Usage:
``` <!---sh-->
bin/format-headers.sh
```
<div id="gen-authors">
### [gen-authors.sh](%%REPO_URL%%/bin/gen-authors.sh)
</div>
@@ -223,6 +240,7 @@ We recommend that this tool be invoked via the top level `Makefile` by:
make gen_location
```
<div id="gen-other-html">
### [gen-other-html.sh](%%REPO_URL%%/bin/gen-other-html.sh)
</div>
@@ -242,6 +260,7 @@ We recommend that this tool be invoked via the top level `Makefile` by:
make gen_other_html
```
<div id="gen-sitemap">
### [gen-sitemap.sh](%%REPO_URL%%/bin/gen-sitemap.sh)
</div>
@@ -309,6 +328,7 @@ We recommend that this tool be invoked via the top level `Makefile` by:
unless the `contest_status` is to be changed, but since only the judges should
do that, that is not a problem.
<div id="gen-top-html">
### [gen-top-html.sh](%%REPO_URL%%/bin/gen-top-html.sh)
</div>
@@ -365,6 +385,7 @@ We recommend that this tool be invoked via the top level `Makefile` by:
which will create the `index.html` for every IOCCC year (`1984/index.html`,
`1985/index.html` etc.).
<div id="gen-years">
### [gen-years.sh](%%REPO_URL%%/bin/gen-years.sh)
</div>
@@ -447,7 +468,9 @@ This tool is used in the [bin/md2html.cfg](%%REPO_URL%%/bin/md2html.cfg) file as
the [md2html tool](index.html#md2html).
<div id="output-year-index">
### [output-year-index.sh](%%REPO_URL%%/bin/output-year-index.sh)
</div>
Output the inventory for a given year's winning entries in HTML form. In other
words in [1984](../1984/index.html) it would list, as links, the four winning
@@ -458,7 +481,9 @@ This tool is used in the [bin/md2html.cfg](%%REPO_URL%%/bin/md2html.cfg) file as
the [md2html tool](index.html#md2html).
<div id="pandoc-wrapper">
### [pandoc-wrapper.sh](%%REPO_URL%%/bin/pandoc-wrapper.sh)
</div>
Wrapper tool to run `pandoc(1)`.
@@ -595,6 +620,7 @@ Print substitutions for an entry's `index.html`.
This tool is used in the [bin/md2html.cfg](%%REPO_URL%%/bin/md2html.cfg) file.
<div id="subst-entry-navbar-awk">
### [subst.entry-navbar.awk](%%REPO_URL%%/bin/subst.entry-navbar.awk)
</div>
@@ -612,6 +638,7 @@ Print substitutions for a year level `index.html`.
This tool is used in the [bin/md2html.cfg](%%REPO_URL%%/bin/md2html.cfg) file.
<div id="subst-year-navbar-awk">
### [subst.year-navbar.awk](%%REPO_URL%%/bin/subst.year-navbar.awk)
</div>
@@ -620,6 +647,7 @@ Output substitutions for `navbar` on behalf of a year level `index.html`.
This tool is used in [subst.year-index.sh](index.html#subst-year-index).
<div id="tar-entry">
## [tar-entry.sh](%%REPO_URL%%/bin/tar-entry.sh)
</div>
@@ -766,7 +794,6 @@ For example:
will cause no HTML content to be produced during the `footer` HTML phase.
<div id="html">
## HTML phases
</div>
@@ -831,6 +858,7 @@ it is a file under topdir.
`getopt` phase 0 is the only `getopt` phase where `-d topdir` and `-c
md2html.cfg` may be used.
<div id="getopt-1">
### `getopt` phase 1
</div>
@@ -845,6 +873,7 @@ The `-o "output tool"` is not allowed to output another `"-o tool"` or a `"-O
tool=optstr"`. Instead a `-o "output tool"` may execute another `-o "output
tool"` and merge the output into its own.
<div id="getopt-2">
### `getopt` phase 2
</div>
@@ -854,6 +883,7 @@ matched by a saved argument.
The match is made with the (possibly modified) phase 0 argument.
<div id="getopt-3">
### `getopt` phase 3
</div>
@@ -868,6 +898,7 @@ The `-o "output tool"` is not allowed to output another `"-o tool"` or a `"-O
tool=optstr"`. Instead a `-o "output tool"` may execute another `-o "output
tool"` and merge the output into its own.
<div id="command-line-option-order">
### Command line option order
</div>
@@ -931,6 +962,7 @@ When `-E exitcode` is evaluated, the application will exit with the `exitcode`
value. If one wishes to also output a message to `stderr`, the `-e string` must
come **BEFORE** any `-E exitcode` in the command line.
<div id="substitution-tokens">
### Substitution tokens
</div>
@@ -1,13 +1,37 @@
#!/usr/bin/env bash
#
# format-headers.sh - script that formats headers in README.md files so that
# before a line that starts with '##' (as in '^##') that have specific names
# there are two blank lines (\n\n).
# format-headers.sh - format select headers and preceding empty lines in entry README.md files
#
# We formats headers in README.md files so that before a line that starts with
# '##' (as in '^##') that have specific names there are two blank lines (\n\n).
#
# Script written by Landon with minor improvements by Cody Boone Ferguson where
# now it only acts on files under git control rather than any README.md file in
# the [0-9]{4} directories.
#
# Copyright (c) 2023-2024 by Landon Curt Noll. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted,
# provided that the above copyright, this permission notice and text
# this comment, and the disclaimer below appear in all of the following:
#
# supporting documentation
# source copies
# source works derived from this source
# binaries derived from this source or from derived source
#
# LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
# EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
# chongo (Landon Curt Noll, http://www.isthe.com/chongo/index.html) /\oo/\
#
# Share and enjoy! :-)
for i in $(git ls-files '[0-9][0-9][0-9][0-9]/*README.md'); do
perl -0777 -p -i -e 's/([^\n]\n)\n*##*[[:space:]]*(To build):?\n\n*([^\n])?/$1\n\n## $2:\n\n$3/' "$i"
+10
View File
@@ -490,6 +490,12 @@ that is <strong>NOT</strong> an IOCCC markdown best practice.</p>
details.</p>
<p>We recommend that this tool be invoked via the top level <code>Makefile</code> by:</p>
<pre><code> make find_missing_links</code></pre>
<div id="format-headers">
<h3 id="format-headers.sh"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/bin/format-headers.sh">format-headers.sh</a></h3>
</div>
<p>Format select headers and preceding empty lines in entry README.md files.</p>
<p>Usage:</p>
<pre><code> bin/format-headers.sh</code></pre>
<div id="gen-authors">
<h3 id="gen-authors.sh"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/bin/gen-authors.sh">gen-authors.sh</a></h3>
</div>
@@ -628,14 +634,18 @@ inventory, see the <a href="../1984/anonymous/index.html#inventory">inventory in
1984/anonymous</a>.</p>
<p>This tool is used in the <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/bin/md2html.cfg">bin/md2html.cfg</a> file as part of
the <a href="index.html#md2html">md2html tool</a>.</p>
<div id="output-year-index">
<h3 id="output-year-index.sh"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/bin/output-year-index.sh">output-year-index.sh</a></h3>
</div>
<p>Output the inventory for a given year’s winning entries in HTML form. In other
words in <a href="../1984/index.html">1984</a> it would list, as links, the four winning
entries, which you can see directly at <a href="../1984/index.html#inventory">1984
inventory</a>.</p>
<p>This tool is used in the <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/bin/md2html.cfg">bin/md2html.cfg</a> file as part of
the <a href="index.html#md2html">md2html tool</a>.</p>
<div id="pandoc-wrapper">
<h3 id="pandoc-wrapper.sh"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/bin/pandoc-wrapper.sh">pandoc-wrapper.sh</a></h3>
</div>
<p>Wrapper tool to run <code>pandoc(1)</code>.</p>
<div id="quick-readme2index">
<h3 id="quick-readme2index.sh"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/bin/quick-readme2index.sh">quick-readme2index.sh</a></h3>