add hack-a-round for language specified markdown code blocks

When language is specified in a markdown code block such as:

````
```c
    printf("Hello, world!\n");
```
````

is used, the resulting HTML as produced by `pandoc(1)` combined
with our revised `ioccc.css` is not intent the code block well.

A temporary "_hack-a-round_" is to turn the "markdown code language
specifier" into an HTML comment.  For example:

````
```<!---c-->
    printf("Hello, world!\n");
```
````

This commits turns off existing markdown code language specifiers
for now, while preserving our ability to restore them in the future
when a better  "_hack-a-round_" to the "markdown code language
specifier" problem is found.

The HTML impact if this "_hack-a-round_" is to produce HTML that
looks like this:

```
<pre class="&lt;!---c--&gt;"><code> .. </code></pre>
```

We might be able to create a complex set of classes for each markdown
code language (there won't be very many) in `ioccc.css`, or we might
find a more general CSS (or maybe `pandoc(1)`?) solution.

For now, this hack-a-round will have to do.
This commit is contained in:
Landon Curt Noll committed 2024-04-04 14:50:38 -07:00
1 parent 3919df50fb
commit b66c79254a
700 files changed
+7052 -7056

No files matched your search

+11 -11
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -21,20 +21,20 @@ For more detailed information see [2011 vik bugs](../../bugs.html#2011_vik).
## To use:
```sh
```<!---sh-->
./vik file.mod > audio_file.raw
```
If you have `mplayer(1)`:
```sh
```<!---sh-->
./vik file.mod | mplayer -demuxer rawaudio -
```
Alternatively, you can convert the file to a WAV:
```sh
```<!---sh-->
./vik file.mod > file.raw; ./raw2wav file.raw > file.wav
```
@@ -43,7 +43,7 @@ and then play `file.wav` with a program that can play WAV files.
## Try:
```sh
```<!---sh-->
./try.sh
```
@@ -66,7 +66,7 @@ This version is based on the author's remarks and it should work for Windows.
Assuming that `make` is similar enough try:
```sh
```<!---sh-->
make alt
```
@@ -87,7 +87,7 @@ initialization for?
Does it take your system a long time to compile? You may want to do:
```sh
```<!---sh-->
cc -S vik.c
```
@@ -153,7 +153,7 @@ Bertilsson, also known as Deelite:
Compiling for Unix systems (including cygwin) is straight forward:
```sh
```<!---sh-->
gcc -o vik vik.c
```
@@ -162,13 +162,13 @@ Compiling for Unix systems (including cygwin) is straight forward:
#### Convert MOD file to raw 44.1kHz stereo audio file
```sh
```<!---sh-->
./vik mad_world.mod > audio_file.raw
```
#### Listen to the MOD file (streaming to mplayer)
```sh
```<!---sh-->
./vik randowan.mod | mplayer -demuxer rawaudio -
```
@@ -210,7 +210,7 @@ Microsoft compilers adds a carriage return to newlines, and to compile
the program with this platform, the following line can be added after
the main declaration in order for the program to run correctly:
```c
```<!---c-->
_setmode(_fileno(stdout), 0x8000);
```
+11 -11
View File
@@ -141,7 +141,7 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- 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></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<p>There is an alternate version that should work for Windows. See <a href="#alternate-code">alternate
code</a> below.</p>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
@@ -149,14 +149,14 @@ code</a> below.</p>
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2011_vik">2011 vik 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">./vik</span> file.mod <span class="op">&gt;</span> audio_file.raw</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./vik file.mod &gt; audio_file.raw</code></pre>
<p>If you have <code>mplayer(1)</code>:</p>
<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">./vik</span> file.mod <span class="kw">|</span> <span class="ex">mplayer</span> <span class="at">-demuxer</span> rawaudio <span class="at">-</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./vik file.mod | mplayer -demuxer rawaudio -</code></pre>
<p>Alternatively, you can convert the file to a WAV:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./vik</span> file.mod <span class="op">&gt;</span> file.raw<span class="kw">;</span> <span class="ex">./raw2wav</span> file.raw <span class="op">&gt;</span> file.wav</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./vik file.mod &gt; file.raw; ./raw2wav file.raw &gt; file.wav</code></pre>
<p>and then play <code>file.wav</code> with a program that can play WAV files.</p>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<p>The script checks that you have <code>mplayer(1)</code> installed and if it is it will pipe
<code>vik</code> to <code>mplayer</code>. In this case it will also use <code>raw2wav</code> to convert the file
to a WAV file. If <code>mplayer(1)</code> cannot be found it will just use <code>raw2wav</code>. This
@@ -168,7 +168,7 @@ Archive</a>.</p>
<p>This version is based on the author’s remarks and it should work for Windows.</p>
<h3 id="alternate-build">Alternate build:</h3>
<p>Assuming that <code>make</code> is similar enough try:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>vik.alt</code> as you would <code>vik</code> above.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
@@ -178,7 +178,7 @@ in a most pleasing manner if you don’t like tremolo or vibrato.</p>
initialized 32MB array. Can you tell what that partial
initialization for?</p>
<p>Does it take your system a long time to compile? You may want to do:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">cc</span> <span class="at">-S</span> vik.c</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> cc -S vik.c</code></pre>
<p>and examine the resulting assembly file <code>vik.s</code>. On some platforms
the assembly file is about 128MB in size!</p>
<p>NOTE: The <a href="randowan.mod">randowan.mod</a> and <a href="mad_world.mod">mad_world.mod</a> files were
@@ -225,12 +225,12 @@ Bertilsson, also known as Deelite:</p>
</ol>
<h3 id="build">Build</h3>
<p>Compiling for Unix systems (including cygwin) is straight forward:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">gcc</span> <span class="at">-o</span> vik vik.c</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> gcc -o vik vik.c</code></pre>
<h3 id="usage">Usage</h3>
<h4 id="convert-mod-file-to-raw-44.1khz-stereo-audio-file">Convert MOD file to raw 44.1kHz stereo audio file</h4>
<div class="sourceCode" id="cb10"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./vik</span> mad_world.mod <span class="op">&gt;</span> audio_file.raw</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./vik mad_world.mod &gt; audio_file.raw</code></pre>
<h4 id="listen-to-the-mod-file-streaming-to-mplayer">Listen to the MOD file (streaming to mplayer)</h4>
<div class="sourceCode" id="cb11"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./vik</span> randowan.mod <span class="kw">|</span> <span class="ex">mplayer</span> <span class="at">-demuxer</span> rawaudio <span class="at">-</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./vik randowan.mod | mplayer -demuxer rawaudio -</code></pre>
<p>(Don’t forget the last <code>-</code> as it makes mplayer read from <code>stdin</code>.)</p>
<h3 id="obfuscation">Obfuscation</h3>
<p>The IOCCC rules did not put a limit on the entropy of the source code,
@@ -256,7 +256,7 @@ that the program relies on writing binary data to <code>stdout</code>.</p>
<p>Microsoft compilers adds a carriage return to newlines, and to compile
the program with this platform, the following line can be added after
the main declaration in order for the program to run correctly:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a> _setmode<span class="op">(</span>_fileno<span class="op">(</span>stdout<span class="op">),</span> <span class="bn">0x8000</span><span class="op">);</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> _setmode(_fileno(stdout), 0x8000);</code></pre>
<p>NOTE: this is what the <a href="#alternate-code">alternate version</a> is for.</p>
<h3 id="limitations">Limitations</h3>
<p>The program only runs when a valid MOD file is passed as argument. If