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="<!---c-->"><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:
1 parent
3919df50fb
commit
b66c79254a
700 files changed
+7052
-7056
No files matched your search
+11
-11
@@ -1,13 +1,13 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./bmeyer
|
||||
```
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
In a video window (white text on black background):
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -31,7 +31,7 @@ dashed argument) for compression and decompression! You've been warned.
|
||||
|
||||
The author recommended on linux/x86, glibc 2.0, libc4/5:
|
||||
|
||||
```make
|
||||
```<!---make-->
|
||||
bmeyer: bmeyer.c
|
||||
CC -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm
|
||||
```
|
||||
@@ -40,7 +40,7 @@ However many compilers use `-O3` as the maximum level for `-O` optimization.
|
||||
|
||||
And on linux/x86, glibc 2.1:
|
||||
|
||||
```make
|
||||
```<!---make-->
|
||||
bmeyer: bmeyer.c
|
||||
gcc -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' $? -o $@ -lm
|
||||
```
|
||||
@@ -80,13 +80,13 @@ on stdin, and it will decompress it to stdout --- as either raw or
|
||||
ASCII .PGM, depending on what format it was compressed from. For
|
||||
example:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./glicbawls < michael.pgm > michael.glic
|
||||
```
|
||||
|
||||
and then
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./glicbawls < michael.glic > michael.decoded.pgm
|
||||
```
|
||||
|
||||
@@ -104,7 +104,7 @@ If you still have trouble, simply use a terminal or xterm with
|
||||
more than 80 columns, and tell `glicbawls` about it by giving the
|
||||
number of columns as an argument. For example
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./glicbawls 260 <lavabus.pgm >lavabus.glic
|
||||
```
|
||||
|
||||
@@ -122,21 +122,21 @@ decoded as 35, 36, 37, 38 or 39. In order to use this mode, simply
|
||||
give the maximum allowed error as an argument, with a dash (`-`)
|
||||
before it. For example:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./glicbawls -2 < graph.pgm > graph.2.glic
|
||||
```
|
||||
|
||||
will compress in a way that allows decompression with a maximum
|
||||
error of two. You can combine both types of arguments, i.e.:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./glicbawls -3 180 < graph.pgm >graph.3.glic
|
||||
```
|
||||
|
||||
will compress with a maximum error of 3, using a 180 column
|
||||
terminal for the progress display, and:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./glicbawls -3 180 < graph.3.glic > graph.3maxerr.pgm
|
||||
```
|
||||
|
||||
|
||||
+11
-11
@@ -141,23 +141,23 @@ Location: <a href="../../location.html#AU">AU</a> - <em>Commonwealth of Australi
|
||||
<!-- 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="<!---sh-->"><code> make</code></pre>
|
||||
<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">./bmeyer</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./bmeyer</code></pre>
|
||||
<h2 id="try">Try:</h2>
|
||||
<p>In a video window (white text on black background):</p>
|
||||
<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="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<p>The script will suggest you compare the output of the program with images,
|
||||
prompting you to press any key to continue so that you may do so.</p>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>Don’t even think of supplying different compression factors (the
|
||||
dashed argument) for compression and decompression! You’ve been warned.</p>
|
||||
<p>The author recommended on linux/x86, glibc 2.0, libc4/5:</p>
|
||||
<pre class="make"><code> bmeyer: bmeyer.c
|
||||
<pre class="<!---make-->"><code> bmeyer: bmeyer.c
|
||||
CC -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm</code></pre>
|
||||
<p>However many compilers use <code>-O3</code> as the maximum level for <code>-O</code> optimization.</p>
|
||||
<p>And on linux/x86, glibc 2.1:</p>
|
||||
<pre class="make"><code> bmeyer: bmeyer.c
|
||||
<pre class="<!---make-->"><code> bmeyer: bmeyer.c
|
||||
gcc -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' $? -o $@ -lm</code></pre>
|
||||
<p>Compile with the maximum possible optimization on your system.
|
||||
If your system has 80-bit internal representation of floating
|
||||
@@ -184,9 +184,9 @@ output a compressed version to stdout. Feed it a compressed file
|
||||
on stdin, and it will decompress it to stdout — as either raw or
|
||||
ASCII .PGM, depending on what format it was compressed from. For
|
||||
example:</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">./glicbawls</span> <span class="op"><</span> michael.pgm <span class="op">></span> michael.glic</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./glicbawls < michael.pgm > michael.glic</code></pre>
|
||||
<p>and then</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">./glicbawls</span> <span class="op"><</span> michael.glic <span class="op">></span> michael.decoded.pgm</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./glicbawls < michael.glic > michael.decoded.pgm</code></pre>
|
||||
<p>As it turns out, <code>glicbawls</code> compresses greyscale images (or, more
|
||||
precisely, “natural” greyscale images) better than any other
|
||||
program I am aware of (with the exception of the not-yet-published
|
||||
@@ -199,7 +199,7 @@ have trouble recognizing the image, try squinting at it ;-).</p>
|
||||
<p>If you still have trouble, simply use a terminal or xterm with
|
||||
more than 80 columns, and tell <code>glicbawls</code> about it by giving the
|
||||
number of columns as an argument. For example</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">./glicbawls</span> 260 <span class="op"><</span>lavabus.pgm <span class="op">></span>lavabus.glic</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./glicbawls 260 <lavabus.pgm >lavabus.glic</code></pre>
|
||||
<p>will allow <code>glicbawls</code> to use up to 260 columns, which makes things
|
||||
much more recognizable.</p>
|
||||
<p>Still running out of space? Need to compress those images just a
|
||||
@@ -212,13 +212,13 @@ error of 2 is allowed, an original pixel value of 37 could be
|
||||
decoded as 35, 36, 37, 38 or 39. In order to use this mode, simply
|
||||
give the maximum allowed error as an argument, with a dash (<code>-</code>)
|
||||
before it. For example:</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">./glicbawls</span> <span class="at">-2</span> <span class="op"><</span> graph.pgm <span class="op">></span> graph.2.glic</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./glicbawls -2 < graph.pgm > graph.2.glic</code></pre>
|
||||
<p>will compress in a way that allows decompression with a maximum
|
||||
error of two. You can combine both types of arguments, i.e.:</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">./glicbawls</span> <span class="at">-3</span> 180 <span class="op"><</span> graph.pgm <span class="op">></span>graph.3.glic</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./glicbawls -3 180 < graph.pgm >graph.3.glic</code></pre>
|
||||
<p>will compress with a maximum error of 3, using a 180 column
|
||||
terminal for the progress display, and:</p>
|
||||
<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">./glicbawls</span> <span class="at">-3</span> 180 <span class="op"><</span> graph.3.glic <span class="op">></span> graph.3maxerr.pgm</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./glicbawls -3 180 < graph.3.glic > graph.3maxerr.pgm</code></pre>
|
||||
<p>will decompress the result on such a terminal.</p>
|
||||
<p>But wait, there is more — you can also feed <code>glicbawls</code> .PPM files
|
||||
(i.e. colour images), raw or ASCII, your choice. <code>glicbawls</code> will
|
||||
|
||||
Reference in new issue
Block a user