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
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -18,7 +18,7 @@ For more detailed information see [2013 dlowe bugs](../../bugs.html#2013_dlowe).
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./dlowe [number...]
|
||||
```
|
||||
|
||||
@@ -27,13 +27,13 @@ where `[number...]` is one or more number, space separated.
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
What is different about the above if you do something like:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
echo 'IOCCC winning entry 2013/dlowe' > ioccc.txt
|
||||
./try.sh
|
||||
rm -f ioccc.txt
|
||||
@@ -43,7 +43,7 @@ What is different about the above if you do something like:
|
||||
|
||||
To make it simpler to see try showing just the different line like:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./diff.sh
|
||||
```
|
||||
|
||||
@@ -58,7 +58,7 @@ with one argument or when all arguments are equal?
|
||||
|
||||
For extra fun, compile and run [fun.c](fun.c):
|
||||
|
||||
```c
|
||||
```<!---c-->
|
||||
#include <stdio.h>
|
||||
int main() {
|
||||
printf("%d %d %d\n", (int)(-1.0/0.0), (int)(0.0/0.0), (int)(1.0/0.0));
|
||||
@@ -91,7 +91,7 @@ Which one is correct? :)
|
||||
NOTE: `make all` will compile [fun.c](fun.c) but to provide a different compiler
|
||||
you can do something like:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make CC=clang fun
|
||||
```
|
||||
|
||||
@@ -105,7 +105,7 @@ A tiny implementation of command-line
|
||||
|
||||
### Synopsis
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
$ ./sparkl 0 1 2 3 4 5 6 7
|
||||
▁▂▃▄▅▆▇▉
|
||||
|
||||
@@ -115,7 +115,7 @@ A tiny implementation of command-line
|
||||
|
||||
NOTE: this has been provided in [slflen.sh](slflen.sh) so you can try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./slflen.sh
|
||||
```
|
||||
|
||||
|
||||
+18
-18
@@ -141,33 +141,33 @@ 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="<!---sh-->"><code> make</code></pre>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a href="../../bugs.html#2013_dlowe">2013 dlowe 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">./dlowe</span> <span class="pp">[</span><span class="ss">number...</span><span class="pp">]</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./dlowe [number...]</code></pre>
|
||||
<p>where <code>[number...]</code> is one or more number, space separated.</p>
|
||||
<h2 id="try">Try:</h2>
|
||||
<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">./try.sh</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<p>What is different about the above if you do something like:</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="bu">echo</span> <span class="st">'IOCCC winning entry 2013/dlowe'</span> <span class="op">></span> ioccc.txt</span>
|
||||
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span>
|
||||
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">rm</span> <span class="at">-f</span> ioccc.txt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> echo 'IOCCC winning entry 2013/dlowe' > ioccc.txt
|
||||
./try.sh
|
||||
rm -f ioccc.txt</code></pre>
|
||||
<p>?</p>
|
||||
<p>To make it simpler to see try showing just the different line like:</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">./diff.sh</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./diff.sh</code></pre>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>We liked how this entry used Unicode, specifically UTF-8, in a somewhat
|
||||
obfuscated way.</p>
|
||||
<p>Also, why doesn’t it crash but instead produces a correct output when called
|
||||
with one argument or when all arguments are equal?</p>
|
||||
<p>For extra fun, compile and run <a href="fun.c">fun.c</a>:</p>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#include </span><span class="im"><stdio.h></span></span>
|
||||
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">int</span> main<span class="op">()</span> <span class="op">{</span></span>
|
||||
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">"</span><span class="sc">%d</span><span class="st"> </span><span class="sc">%d</span><span class="st"> </span><span class="sc">%d\n</span><span class="st">"</span><span class="op">,</span> <span class="op">(</span><span class="dt">int</span><span class="op">)(-</span><span class="fl">1.0</span><span class="op">/</span><span class="fl">0.0</span><span class="op">),</span> <span class="op">(</span><span class="dt">int</span><span class="op">)(</span><span class="fl">0.0</span><span class="op">/</span><span class="fl">0.0</span><span class="op">),</span> <span class="op">(</span><span class="dt">int</span><span class="op">)(</span><span class="fl">1.0</span><span class="op">/</span><span class="fl">0.0</span><span class="op">));</span></span>
|
||||
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span></code></pre></div>
|
||||
<pre class="<!---c-->"><code> #include <stdio.h>
|
||||
int main() {
|
||||
printf("%d %d %d\n", (int)(-1.0/0.0), (int)(0.0/0.0), (int)(1.0/0.0));
|
||||
}</code></pre>
|
||||
<p>with gcc and clang.</p>
|
||||
<p>With GCC (4.7.2), we get</p>
|
||||
<pre><code> -2147483648 -2147483648 -2147483648</code></pre>
|
||||
@@ -178,19 +178,19 @@ with one argument or when all arguments are equal?</p>
|
||||
<p>Which one is correct? :)</p>
|
||||
<p>NOTE: <code>make all</code> will compile <a href="fun.c">fun.c</a> but to provide a different compiler
|
||||
you can do something like:</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="fu">make</span> CC=clang fun</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make CC=clang fun</code></pre>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
<h3 id="sparkl">sparkl</h3>
|
||||
<p>A tiny implementation of command-line
|
||||
<a href="https://en.wikipedia.org/wiki/Sparkline">sparkline</a> data visualization.</p>
|
||||
<h3 id="synopsis">Synopsis</h3>
|
||||
<div class="sourceCode" id="cb12"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> ./sparkl 0 1 2 3 4 5 6 7</span>
|
||||
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">▁▂▃▄▅▆▇▉</span></span>
|
||||
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> echo <span class="st">"sparkline of file lengths: </span><span class="va">$(</span><span class="fu">wc</span> <span class="at">-c</span> <span class="pp">*</span> <span class="kw">|</span> <span class="fu">awk</span> <span class="st">'{print $1}'</span> <span class="kw">|</span> <span class="fu">xargs</span> ./sparkl<span class="va">)</span><span class="st">"</span></span>
|
||||
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true" tabindex="-1"></a> <span class="ex">sparkline</span> of file sizes: ▁▁▁▃▃▂▁▂▁▁▉</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> $ ./sparkl 0 1 2 3 4 5 6 7
|
||||
▁▂▃▄▅▆▇▉
|
||||
|
||||
$ echo "sparkline of file lengths: $(wc -c * | awk '{print $1}' | xargs ./sparkl)"
|
||||
sparkline of file sizes: ▁▁▁▃▃▂▁▂▁▁▉</code></pre>
|
||||
<p>NOTE: this has been provided in <a href="slflen.sh">slflen.sh</a> so you can try:</p>
|
||||
<div class="sourceCode" id="cb13"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./slflen.sh</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./slflen.sh</code></pre>
|
||||
<p>instead (which <a href="try.sh">try.sh</a> also uses).</p>
|
||||
<h3 id="description">Description</h3>
|
||||
<p>This is a handy little tool for visualizing numeric series from the
|
||||
|
||||
Reference in new issue
Block a user