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

+10 -10
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -10,7 +10,7 @@ binary mode from text mode. See [alternate code](#alternate-code) below.
## To use:
```sh
```<!---sh-->
./zucker > image.ppm
```
@@ -19,7 +19,7 @@ Now open `image.ppm` with your image viewer of choice.
## Try:
```sh
```<!---sh-->
./try.sh
```
@@ -36,7 +36,7 @@ that distinguish binary and text.
### Alternate build:
```sh
```<!---sh-->
make alt
```
@@ -68,7 +68,7 @@ This entry uses no local variables. None! At! All!
This program makes pretty pictures. To see the default output, try
running
```sh
```<!---sh-->
./zucker > ioccc2011.ppm
```
@@ -82,7 +82,7 @@ Netpbm files, and are available on multiple platforms.
With macOS you can type at the command line:
```sh
```<!---sh-->
open ioccc2021.ppm
```
@@ -90,7 +90,7 @@ and it will open image in the default application Preview.app.
To use ImageMagick you might do something like:
```sh
```<!---sh-->
convert ioccc2011.ppm ioccc2011.png
```
@@ -98,7 +98,7 @@ and then open `ioccc2011.png` in your viewer of choice.
To use GraphicsMagick you might do something like:
```sh
```<!---sh-->
gm convert ioccc2011.ppm ioccc2011.png
```
@@ -107,14 +107,14 @@ and then open `ioccc2011.png` in your viewer of choice.
Aside from the default image, you may create your own by running the
program as follows:
```sh
```<!---sh-->
./zucker "your text" > image.ppm
```
To mitigate long runtime, the program can be invoked in a "preview"
mode by appending `-preview` to the command line arguments, like so:
```sh
```<!---sh-->
./zucker faster\! -preview > image.ppm
```
+10 -10
View File
@@ -141,14 +141,14 @@ 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 which should work for Windows which distinguishes
binary mode from text mode. See <a href="#alternate-code">alternate code</a> below.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./zucker</span> <span class="op">&gt;</span> image.ppm</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./zucker &gt; image.ppm</code></pre>
<p>Now open <code>image.ppm</code> with your image viewer of choice.</p>
<h2 id="try">Try:</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">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<p>After running <code>try.sh</code>, open the PPM images <code>ioccc.ppm</code>, <code>hello.ppm</code> and
<code>image2.ppm</code> with your image viewer of choice.</p>
<h2 id="alternate-code">Alternate code:</h2>
@@ -156,7 +156,7 @@ binary mode from text mode. See <a href="#alternate-code">alternate code</a> bel
binary mode on <code>stdout</code> which the author noted would be necessary for systems
that distinguish binary and text.</p>
<h3 id="alternate-build">Alternate build:</h3>
<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="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>zucker.alt</code> as you would <code>zucker</code> above.</p>
<h3 id="alternate-try">Alternate try:</h3>
@@ -170,7 +170,7 @@ The vector font is proportional.</p>
<h4 id="what-it-does">What it does:</h4>
<p>This program makes pretty pictures. To see the default output, try
running</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">./zucker</span> <span class="op">&gt;</span> ioccc2011.ppm</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./zucker &gt; ioccc2011.ppm</code></pre>
<p>On the author’s 2.5 GHz MacBook Pro, this command takes approximately 1 minute
and 18 seconds to run – your runtime may vary. You will need an image viewer
capable of displaying <a href="https://en.wikipedia.org/wiki/Netpbm">Netpbm images</a> in
@@ -179,20 +179,20 @@ well; otherwise <a href="http://www.imagemagick.org/">ImageMagick</a> and/or
<a href="http://www.graphicsmagick.org/">GraphicsMagick</a> are both capable of displaying
Netpbm files, and are available on multiple platforms.</p>
<p>With macOS you can type at the command line:</p>
<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">open</span> ioccc2021.ppm</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> open ioccc2021.ppm</code></pre>
<p>and it will open image in the default application Preview.app.</p>
<p>To use ImageMagick you might do something like:</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="ex">convert</span> ioccc2011.ppm ioccc2011.png</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> convert ioccc2011.ppm ioccc2011.png</code></pre>
<p>and then open <code>ioccc2011.png</code> in your viewer of choice.</p>
<p>To use GraphicsMagick you might do something like:</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="ex">gm</span> convert ioccc2011.ppm ioccc2011.png</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> gm convert ioccc2011.ppm ioccc2011.png</code></pre>
<p>and then open <code>ioccc2011.png</code> in your viewer of choice.</p>
<p>Aside from the default image, you may create your own by running the
program as follows:</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="ex">./zucker</span> <span class="st">&quot;your text&quot;</span> <span class="op">&gt;</span> image.ppm</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./zucker &quot;your text&quot; &gt; image.ppm</code></pre>
<p>To mitigate long runtime, the program can be invoked in a “preview”
mode by appending <code>-preview</code> to the command line arguments, like so:</p>
<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">./zucker</span> faster<span class="dt">\!</span> <span class="at">-preview</span> <span class="op">&gt;</span> image.ppm</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./zucker faster\! -preview &gt; image.ppm</code></pre>
<p>If your platform distinguishes between binary and text streams, you may need to
insert some code to reopen standard output in binary mode at the start of
<code>main()</code> (the provided <a href="#alternate-code">alternate version</a> will set binary mode