The initial release of `bin/readme2index.sh` tool that converts
`READMD.md` and various JSON files such as `.winner.json`
as well as "author/author_handle.json" files.
Applied the `readme2index.sh` tool to generate `2020/ferguson1/index.html`.
We generated the `2020/ferguson1/index.html` by executing:
```sh
./bin/readme2index.sh -v 3 2020/ferguson1
```
NOTE: This above tool requires **pandoc to be installed**.
See the [pandoc web site](https://pandoc.org) for how
to install. We used _HomeBrew_ to install it,
but there is also a _macports_ process as well.
NOTE: While the above web page does have formatting issues, it is
a first attempt data driven programmatic web page generation.
Some adjustments can be made by mostly improving `ioccc.css`,
and some perhaps by modifying how `bin/pandoc_wrapper.sh`
invokes pandoc. But probably most of the improvements can
be made by fixing and improving `ioccc.css`.
TODO: Fix and improve the `2020/ferguson1/index.html`
web page by fixing and improving `ioccc.css`.
Moved scripts and tools needed to generate HTML pages
into a new `/bin` subdirectory.
TODO: Consider getting rid of the [build-ioccc
repo](https://github.com/ioccc-src/build-ioccc) and just use the
`/bin` subdirectory.
NOTE: Some links in the `2020/ferguson1/index.html`
web page do not (yet) exist.
TODO: Once the basic format of the `2020/ferguson1/index.html` web
page is somewhat reasonable, generate `index.html` pages for other
winners. Generate the year level `index.html' files.
Generate the top level HTML files, including the missing
`location.html` file.
Greatly simplified the `.winner.json` file format,
removing a number of fields that were not strictly needed
for generating an inventory on a `index.html` page.
Updated various versions:
* `bin/gen-author.sh` VERSION="1.3 2024-01-14"
* `bin/gen-inventory.sh` VERSION="1.0 2024-01-14"
* `bin/manifest.winner.json.awk` VERSION="1.0 2024-01-14"
* `bin/pandoc_wrapper.sh` VERSION="1.3 2024-01-14"
* `bin/readme2index.sh` VERSION="1.0 2024-01-14"
* `bin/subst.default.sh` VERSION="1.1 2024-01-14"
* `bin/subst.winner-index.sh` VERSION="1.1 2024-01-14"
* `tmp/gen_path_list.found.sh` VERSION="1.1 2024-01-14"
* `tmp/gen_winner_json.sh` VERSION="1.1 2024-01-14"
The `.winner.json` file format from winner_JSON_format_version
"0.5 2023-11-04" to "1.0 2024-01-14".
All `.winner.json` files have been updated to use the
new `.winner.json` file format.
The manifest (`tmp/manifest.numbers` and `tmp/manifest.csv`) has
updated to use the new `.winner.json` file format.
The following procedure was used to generate the
`tmp/manifest.csv` manifest file:
0. open [manifest.numbers](manifest.numbers) in numbers: modify if/as needed
NOTE: Please try to keep the [manifest.numbers](manifest.numbers) spreadsheet
in order order. Use Organize -> Sort -> ((Sort Now)) to sort.
NOTE: Empty fields in the [manifest.numbers](manifest.numbers) spreadsheet
are not allowed. By default, a cell that is empty is colored
as a warning.
1. File -> Export To -> CSV...
* 1a. `[ ]` Include table names (unset)
* 1b. Text Encoding: Unicode (UTF-8)
* 1c. Click ((Save..))
2. Save As: manifest.csv
* 2a. Select the `tmp` directory
3. Click ((Export))
* 3a. If needed click ((Replace))
4. Execute ./tmp/[fix_csv.sh](fix_csv.sh)
NOTE: You must run the [fix_csv.sh](fix_csv.sh) in the above
step in order to make the CSV file usable by other tools.
NOTE: If no changes are needed in the above step, the
original file content will be restored.
5. Execute ./tmp/[gen_path_list.found.sh](gen_path_list.found.sh)
NOTE: The above step silently performs a `make clobber` at the
top level, and so it takes a bit of time.
NOTE: If no changes are needed in the above step, the
original file content will be restored.
6. Execute ./tmp/[check_path_list.sh](check_path_list.sh)
NOTE: The above step prints nothing and for an exit 0, then
all is well. If there is a problem, such as files
found that are not part of the manifest, or files
in the manifest that are not found, then an error
message will be printed and the tool will exit non-zero.
If errors are reported, go back to step 0 and
correct the errors.
7. Execute ./tmp/[run_all.sh](run_all.sh) ./gen_winner_json.sh
NOTE: The above step will take a few seconds to run. It will rebuild
all `.winner.json` files for all winners.
NOTE: If no changes are needed in the above step, the
original file content will be restored.
8. Execute `git status` and inspect changes
NOTE: Check in changes if and as needed.
NOTE: In a number of shell scripts under `bin/*.sh`,
and in the `bin/manifest.winner.json.awk` script
you will find comments of the form:
```
```
This is a note that when tools such as `jnamval` (and `jval` and `jfmt`) are
ready, these gross hacks should be replaced with calls to those tools.
Until they are ready, some must be careful with the layout of JSON files.
A number of bugs and typos have been fixed.
NOTE: Fixing typos in the files touched by this comment is welcome.
This includes scripts, data files, text files, etc.
The _inventory_order_, _display_as_, _display_via_github_. and
_winners_text_ fields of the [manifest.numbers](manifest.numbers)
spreadsheet were just set to have some initial values.
As they impact the inventory displayed on `index.html` pages,
their content needs to be improved.
NOTE: Improving the above mentioned fields of the
[manifest.numbers](manifest.numbers) spreadsheet is welcome.
Update the manifest as per recent file changes.
Removed inventory.html from all winners as the inventory will be
added to the winner `index.html` instead,
Updated winner `.winner.json` files as per the above.
The script had "s surrounding the git ls-files command which turned it
to a single file which of course is wrong.
Ran script again fixing many README.md files that had incorrect number
of blank lines for critical headers.
This will have to be done a final but a good number of files have been
corrected.
For the top level and year level README.md, where email are found,
a note was added to the effect that email addresses found above are
for historical purposes only, and should not be used today.
Old references to asking for fixes, comments, when content was used,
and next contest links were replaced with a general reference to the FAQ.
Harmonized the Copyright and License and copyright dates.
Now using Creative Commons "CC BY-SA 4.0 DEED Attribution-ShareAlike 4.0
International".
The above Creative Commons will become the standard for the IOCCC.
Replaced old `png/by-sa-3.0-88x31.png` with a new ` png/by-sa.88x31.png` icon.
Updated the top level HTML files to use the license.
fix experimental web site links in experimental index.html
sync CNAME with https://github.com/ioccc-src/winner/blob/master/CNAME
improve .gitignore files
Added to each .gitignore file, comments on how to sort.
Put into winner .gitignore files, ignore *.dSYM files.
Put into winner .gitignore files, ignore indent.c,
indent.o and indent files. This is done so that the
winner directory can more self contained.
We did not put into winner .gitignore files, however,
excludes of .-files as found in the top level .gitignore file.
As .-files are not allowed by mkiocccentry, the top level
.gitignore file remains sufficient.
Added to year level .gitignore files, excludes of
mkentry or iocccsize files as needed.
Sorted (via sort -d -u) all .gitignore file.
Add .path files to each winner directory: a file containing
the path to the winner directory from the top directory.
Changed YYYY/.year files to contain the paths, from the top
directory, if the winning directories for the given year.
Changed `/.top` to contain the IOCCC years.
Added `make genpath` rule to the top Makefile and the
year Makefiles to generate the above.
Added FAQ 6.8 to `faq.md` to explain the above.
Updated manifest to reflect recent changes to the list of files.
The input.txt file is what the author included in their remarks as
input to try out. This has been integrated into one of the commands to
try in the try section (which did not even have a command to try out -
it just referred to the command in the to use section).
BTW: the author mentioned the Mersenne prime. Did you know that Landon
Curt Noll has held eight world records related to large primes?
The bugs.md file was updated slightly and so was the thanks file, namely
suggesting that it might be possible for further code to be added to the
alt code to make it set up https (they already stated that there might
be a command line that could get it to work).
The alt code should (though untested) work in Windows which
distinguishes between text and binary. It uses the Windows functions
_fileno() and _setmode() to set binary mode on stdout.
The README.md file has been format/typo checked.
Add PET program written in the emulator and add it to the try.sh script.
The try.sh script now explicitly requires one hit 'q' (or 'Q') to quit
(or else killing it or hitting interrupt); after one command is done
(hitting ctrl-c) it shows the menu again which has the quit option in
there. This makes it a bit easier or at least clearer (cleaner?).
The Makefile DATA variable had to be updated after file rename.
There were some other issues in the README.md file as well that I missed
yesterday.
The bugs.md file has been updated pointing out that one has to hit
ctrl-c or whatever the interrupt is set to.
I believe now that this entry should be complete.
The bugs.md file has been updated with INABIAF section. The README.md
refers to this file.
The README.md has had a slight improvement in that references to lines
in the author's remarks have been turned into links.
The try.sh is different from others in that it is a loop showing a menu
with different options to use the emulator. It notes at the start of
each iteration that one has to hit ctrl-c or whatever they have set
their interrupt as.
The test.sh is run by make test. The exit status is ignored as it
returns non-zero.
Format/typo check README.md.
I am not done with this entry as the bugs.md should probably be updated
to note some things the author noted. This will have to come another
time.
It only has one command. This is because I don't want to knacker my
brain and I don't want to damage anyone else's brain either.
Format/typo check README.md.
The code (both alt and entry) no longer assumes that the source code
filename is the same as the running program with '.c' added. Instead it
uses __FILE__. This does make it slightly less obscure (see next part)
but it is also slightly less error prone at least in some cases. The way
it worked before is that it copied to a buffer '*argv' and then used
strcat(3) with the string ".c" to come up with the filename. The author
actually stated:
As long as the source is in the same directory as the executable it
should be able to find it.
... but this was not strictly true. Now as long as the source file it
was compiled as is in the directory it will find it even if the
executable was copied/linked/renamed to something else.
Format/typo check README.md file.
The script did not check if all versions could be compiled, just that
180 versions were found. Now it reports an error if not all versions
(180) are found (exit code 1) or if any of the versions failed to
compile (exit code 2). Otherwise it returns 0, success.
The regexp for finding errors is '[^-]error' because the CFLAGS contain
the option -Wno-error which would be a false positive.
Now if any version fails to compile it will let the user know. Also in
that case out.count is kept so that one can look at the problem (it also
tells one how to show the results with grep(1) and even notes that if
they want to report it or try and fix it and open a GitHub pull request
that they're welcome to do so).
The giljade.c file's last line now ends on the column that it used to
before the fix of the test suite mode working. This does not affect the
output of the program and the fix did not either but it feels a bit
better this way anyway.
After one exited less(1) the text about leaving the file there for one
to look at it with an editor was on the same line as other output.
Also use less -X so that the screen is not cleared. That way one can see
the last part of the file that they looked at.
Previously the alt rule in the Makefile defined NO_STTY which stops the
code from using stty(1) at the beginning and at the end. The stty sane
resulted in a bus error in macOS and since the sole purpose was to set
echo back on I changed it to stty echo (which works). (The NO_STTY macro
is still checked, see below.)
Added alt code with vi(m) like movements.
The way to get it to not use stty is to use either make alt-no_stty or
no_stty. The former will compile into anon.alt and the latter will
compile into anon.
Format and typo fix README.md file.
The try.sh script lets one experience the entry without having to use
vi(m) .. you know, in case they're afraid of getting stuck :-) (and it
is easier too). The script leaves the file there (rather than piping to
less(1)) so that one can view it in a text editor if they wish.
The file test.sh runs the test suite mode but it filters out the running
of 'make', instead only showing the lines matching '^Line'. When it's
all done it checks if 180 versions (lines) were found (it writes to
stdout and another file with tee(1)). If it does not find 180 it is an
error and this is reported (with exit 1). If it does find 180 all is
good. The make test rule was added and uses this script.
Format and typo check README.md file.
The try.sh script is for aidan.c; the try.alt.sh is for aidan.alt.c
(which I added some while back based on the author's remarks).
The README.md file has been format and typo fixed.
Rather than check if $(CC) IS gcc or IS clang check for $(CC) containing
gcc or clang. This is because in some systems or conditions the compiler
might not be called JUST gcc or JUST clang. For instance gcc in MacPorts
is called gcc-mp-13 (for example) but without this change one would have
to symlink gcc to gcc-mp-13 or copy it to gcc.
The FAQ has been updated to address this.
Due to GitHub not serving nor rendering HTML files whose filename
starts with "." (dot), we renamed `.inventory.html` to `inventory.html`.
Renamed: `tmp/gen_dot_winner.sh` -> `tmp/gen_winner_json.sh`
Fixed URL generation for GitHub links in `inventory.html`.
The manifest was updated accordingly.
The `tmp/README.md` file was updated accordingly.
Fixed an incorrect author win for "1989_jar.2" in `author_wins.numbers`
and `author_wins.csv`.
Changed winner_JSON_format_version to "0.5 2023-11-04".
Added `gen_dot_winner.sh` tool to generate .winner.json and .inventory.html
for a winner. This tool uses [pandoc](https://pandoc.org) to convert
markdown to HTML.
Used this command to generate `.winner.json` and `.inventory.html` for
all winners:
```sh
./run_all.sh -v 1 -D 1 ./gen_dot_winner.sh
```
Updated `tmp/README.md` to reflect the above.
Retired "fake.gen_inventory.sh" to `tmp/OLD_manifest/fake.gen_inventory.sh`.
Added `-D level` flag to `run_all.sh` to specify the `-v level` for
the tool that is being run.
As requested on GitHub: a tool that will be written, readme2index, will,
as explained:
'... will take the converted HTML from the README.md markdown and
inject it into an HTML template. Things such title, award one and
author information will be injected into the HTML page ahead of the
HTML that was converted from the README.md markdown. Without going
into details of HOW at this time, the result will be a coherent HTML
index.html page with the winner title / award, winning author
information, and important file links come from other sources and
NOT from the README.md file.
The text from the 1st award line, thru the authorship information,
and up to but not including the "## To build:" line in the README.md
file will just get in the way. Moreover authors might be tempted to
try and maintain that top of README.md text instead of working with
the author/_author_handle_.json and winner .winner.json files.
This was done with my[0] sgit(1) (https://github.com/xexyl/sgit) tool like:
sgit -o -n -e '/^## To build:/,$p' '[12][0-9][0-9][0-9]/*/README.md'
[0] Is that shameless self-promotion? I don't know but I don't care: it
is generally a very useful tool and has been used in other repos too.
Besides, I've done it many times before and it's a great example that I
will be adding to the README.md file of the tool, one I hadn't thought
of doing.
Fixed cases where there was a bad trailing backslash.
Improved a few cases where a code block was needed
to highlight some text.
Changed a few cases where a code block needed to
declared as, say, a sh code block.
Fixed a few cases where the winner information was not properly formatted.
Plus a few nits and clarifying text was added.
We introduce a bit of fun, while specifying that something
is "supposed to happen".
NOTE: There is no need to change the INABIAF STATUS. The use
there is perfectly fine.
The `.id` files are no longer needed and so they were removed.
The `winner_id` (the contents of the `.id` files) are simply
a concatenation of "year" and "_" and "dir".
Adjusted `.inventory.html`, `tmp/README.md`,
`tmp/fake.gen_inventory.sh`, and the manifest according
to the above.
The new tool, tmp/fake.gen_inventory.sh, now adds
a fake .inventory.html file to each winner entry.
Once the winner2nventory tool is written, the .inventory.html
will contain links to all winner files listed in the inventory.
For now, the tmp/fake.gen_inventory.sh tool just creates
a placeholder file.