Updated manifest as per recent file changes. Updated winner `.winner.json` to reflect the manifest changes. Added [bin/all_run.sh](bin/all_run.sh) tool to run a command over all winning entries. These tools had slight improvements in the help usage message: * bin/gen-author.sh VERSION="1.3.1 2024-01-16" * bin/gen-inventory.sh VERSION="1.0.1 2024-01-16" * bin/pandoc_wrapper.sh VERSION="1.3.1 2024-01-16" * bin/subst.default.sh VERSION="1.1.1 2024-01-16" * bin/subst.winner-index.sh VERSION="1.1.1 2024-01-16" The `bin/readme2index.sh` tool was improved so that if the `index.html` file exists and the tool forms the exact same content, then the file `index.html` file is NOT touched. * bin/readme2index.sh VERSION="1.1 2024-01-16" We used the following command to generate `index.html` files for all winning entries: ```sh bin/all_run.sh -v 3 bin/readme2index.sh ``` NOTE: We have not (yet) built HTML files above the winner directory level (e.g., no year level nor top level HTML), nor have be built non-index HTML files for winners. NOTE: By default we are running `pandoc(1)` with: ``` --fail-if-warnings=true ``` This means that any problems with markdown to HTML generates an error. This is done to be sure that the HTML conversion is clean. We had to fix the following `README.md` files: * `2000/rince/README.md` The reference [^2] was never used. We made a guess that [^2] applies to the same spot as [^1]. Perhaps there is a better spot where [^2] applies? NOTE: For every reference, there MUST be some place where that reference is used. * 2012/vik/README.md The string "$...$" is assumed to be a TeX encoded string. NOTE: Every "$..$" needs to be backslashed as in "\$..\$". * 2018/burton1/README.md The reference [2] was duplicated. We changed the second [2] to [3]. NOTE: Every reference needs to have a unique number. * 2020/carlini/README.md The string "$...$" is assumed to be a TeX encoded string. NOTE: Every "$..$" needs to be backslashed as in "\$..\$". We also found 2 errors in the `author/author_handle.json` file set: * author/Anonymous_2001.json The `author/Anonymous_2001.json` file was missing. * author/Jari_Arkko.json The winner ID for `1989_jar.1` had a typo.
bin
The directory holds bin directory holds tools that build files, such as HTML content, for the official IOCCC web site.
For HTML content, the bin directory tools makes use of HTML fragments from the inc directory as well as various JSON files and other content from the IOCCC GitHub repo.
bin tools
all_run.sh
Run a command on all winning entries.
gen-author.sh
Output winning author(s) Related HTML.
gen-inventory.sh
Output the inventory in HTML form for a winner index.html page.
ioccc-status.sh
Updates the status.json file.
manifest.winner.json.awk
Output manifest table from a winner .winner.json file.
pandoc_wrapper.sh
Wrapper tool to run pandoc.
readme2index.sh
Convert README.md into index.html.
subst.default.sh
Print default substitutions.
subst.winner-index.sh
Print substitutions for a winner index.html.
subst.winner-navbar.awk
Output substitutions for navbar on behalf of a winner.
How HTML content is built
Files under the inc directory contain HTML fragments that the tools in the bin directory tools use to form HTML content for the official IOCCC web site.
The canonical way that HTML content is built uses, by default, files of the form:
*.default.html
HTML phases
The following HTML phase files are used to build HTML content:
- inc/top.default.html
- inc/head.default.html
- inc/body.default.html
- inc/header.default.html
- inc/topnav.default.html
- inc/begin-row.default.html
- inc/begin-leftcolumn.default.html
- inc/sidenav.default.html
- inc/end-leftcolumn.default.html
- inc/begin-rightcolumn.default.html
- inc/before-content.default.html
Phases 11-19 are reserved for future use.
- ((insert 'before tool' output))
- ((insert 'pandoc wrapper tool' output))
- ((insert 'after tool' output))
Phases 23-29 are reserved for future use.
- inc/after-content.default.html
- inc/end-rightcolumn.default.html
- inc/end-row.default.html
- inc/footer.default.html
- inc/bottom.default.html
Phases 35-39 are reserved for future use.
In the above HTML phase numbers, except during HTML phase numbers 20-29, symbols of the form %%TOKEN%% are substituted. Any %%TOKEN%% printed by the 'before tool' (-b tool), the 'pandoc wrapper tool' (-p tool), and the 'after tool' (-a tool) are ignored (i.e., not substituted).
See the tool readme2index.sh for an example of how HTML phases are implemented.
Tool command line
The command line of tools in the bin directory, and perhaps modified via md2html config file file may change to using a different filename for a given phase.
For example when forming the HTML from 2020/ferguson2/chocolate-cake.md,
a different "topnav" navigation bar is needed. So instead of the
usual top navigation bar that normally directs people to the previous
entry for the year, or go up to the year page, or to the next entry
for the year, a top navigation bar to just go up to the entry's
main page is needed. A line the md2html config file file
that refers to 2020/ferguson1/chocolate-cake.md may specify use
of topnav.up2index.html instead of using the topnav.default.html default.
The HTML phase may be skipped resulting in no HTML output during a given phase. Furthermore, forming HTML content from a given markdown file altogether.
See comments in the md2html config file file for details. See also, the tool readme2index.sh for an example of how such command lines are used.
Use CAUTION when modifying inc files
Some of the files under this directory are used to form MOST of the HTML content on the official IOCCC web site.
These files are used to form MOST of the HTML content on the experimental web site.
... and in particular files under inc that are of the form (called default HTML files) ...:
*.default.html
... contain default content used to form IOCCC HTML / IOCCC web pages.
Instead of editing the default HTML files in order to fix a special web page, consider making a copy of the default file and modifying the md2html config file to refer to the copy instead. That way your special case situation will not impact MOST of the HTML content.
Why do we do not use certain well know HTML technology
You may wonder why we need these files in the first place. You may wonder why we even need the tools in the bin directory when there other solutions available to form web pages.
Static web pages only
Here are some reasons why we are using these files and special tools to create HTML content / IOCCC web pages:
We host official IOCCC web site via GitHub pages. As of the time this file written, only static web pages are supported.
Cannot use server side include
We use static web pages, so use of "server side include" is not available to the IOCCC.
For example, Apache SSI "#include" does not work on GitHub pages.
Cannot use a back-end database
We use static web pages, so use of "back-end database" is not available to the IOCCC.
Cannot use non-GitHub web servers
The GitHub pages have the distributed server capacity needed to handle the huge download volume or Slashdot effect that happens when a IOCCC winners are published.
Most so-called low cost web hosting sites have a somewhat hidden excessive bandwidth charge and/or cap bandwidth when the volume gets too high, and/or do not have the infrastructure that can handle the Slashdot effect.
The IOCCC had experience with people offering web mirrors and even free hosting only to find that the generous benefactor moves on, or their service is purchased by someone else who is not so generous. While it is possible that GitHub might someday suffer a similar fate, for the time being we are betting that GitHub will remain willing to host the IOCCC.
The official IOCCC web site is, after all, primarily C source code with some supporting documentation. As such it is a natural fit for GitHub and GitHub pages.
cannot use the HTML object tag
The < object > HTML tag does not work for our needs.
The browser context relationship between the HTML content holds the HTML tag does not extend into the content that the tag includes. For example, menu bars will not operate as specified by the ioccc CSS.
cannot use the HTML embed tag
The < embed > HTML tag does not work for our needs.
This tag wants one to specify the width and height in pixels. Use of a percentage is not officially supported even if some browsers might do so. Our Responsive Web Design on the ioccc CSS needs to be responsive to small-sized cell phone-like screens, mid-sized table-like screens, as well as large-sized desktop-like screens. Specifying a width and height in pixels will not work well in all of those screen size contexts.
cannot use the HTML iframe tag
The < iframe > HTML tag does not work for our needs.
This tag wants one to specify the width and height in pixels. Use of a percentage is not officially supported even if some browsers might do so. Our Responsive Web Design on the ioccc CSS needs to be responsive to small-sized cell phone-like screens, mid-sized table-like screens, as well as large-sized desktop-like screens. Specifying a width and height in pixels will not work well in all of those screen size contexts.
cannot use JavaScript to include content
We do not use JavaScript to include HTML content.
While the IOCCC may use JavaScript in the future to directly render things like C source code, we will do so in such a way that someone will be able to view official IOCCC web site content with JavaScript disabled.
The IOCCC will NOT MANDATE USE OF JavaScript to view official IOCCC web site.
For this reason, we cannot use JavaScript include HTML content.