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
+13
-13
@@ -141,11 +141,11 @@ 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>
|
||||
<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="bu">echo</span> Some text <span class="kw">|</span> <span class="ex">./prog</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> echo Some text | ./prog</code></pre>
|
||||
<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="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>Before analysing the code in detail we were able to guess two out of four tests
|
||||
this entry uses to tell the 5 languages/flavors apart. Can you find all four?</p>
|
||||
@@ -157,26 +157,26 @@ so you need not worry about this.</p>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
<p><code>Fuuko</code> is a <a href="https://en.wikipedia.org/wiki/Starfish">sea star</a> generator. Feed
|
||||
her some input through <code>stdin</code> to get lots of sea star patterns on <code>stdout</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="fu">cc</span> <span class="at">-O3</span> <span class="at">-std</span><span class="op">=</span>c90 fuuko.c <span class="at">-lm</span> <span class="at">-o</span> fuuko_c90</span>
|
||||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> IOCCC <span class="kw">|</span> <span class="ex">./fuuko_c90</span> <span class="op">></span> output_c90.c</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> cc -O3 -std=c90 fuuko.c -lm -o fuuko_c90
|
||||
echo IOCCC | ./fuuko_c90 > output_c90.c</code></pre>
|
||||
<p>If you compile with a C99 compiler instead of C90, the sea stars will
|
||||
have eyes.</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="fu">cc</span> <span class="at">-O3</span> <span class="at">-std</span><span class="op">=</span>c99 fuuko.c <span class="at">-lm</span> <span class="at">-o</span> fuuko_c99</span>
|
||||
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> IOCCC <span class="kw">|</span> <span class="ex">./fuuko_c99</span> <span class="op">></span> output_c99.c</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> cc -O3 -std=c99 fuuko.c -lm -o fuuko_c99
|
||||
echo IOCCC | ./fuuko_c99 > output_c99.c</code></pre>
|
||||
<p>Don’t like <a href="https://en.wikipedia.org/wiki/Starfish">sea stars</a>? Use a C++98
|
||||
compiler to get a <a href="https://en.wikipedia.org/wiki/Dango">dango</a> instead.</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">g++</span> <span class="at">-O3</span> <span class="at">-std</span><span class="op">=</span>c++98 fuuko.c <span class="at">-lm</span> <span class="at">-o</span> fuuko_cpp98</span>
|
||||
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> IOCCC <span class="kw">|</span> <span class="ex">./fuuko_cpp98</span> <span class="op">></span> output_cpp98.c</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> g++ -O3 -std=c++98 fuuko.c -lm -o fuuko_cpp98
|
||||
echo IOCCC | ./fuuko_cpp98 > output_cpp98.c</code></pre>
|
||||
<p>Don’t like <a href="https://en.wikipedia.org/wiki/Dango">dango</a> either? Use a C++11
|
||||
compiler to get just <a href="https://en.wikipedia.org/wiki/Circle">circles</a> (or <a href="https://en.wikipedia.org/wiki/Swiss_cheeses_and_dairy_products">Swiss
|
||||
cheese</a>, if you
|
||||
prefer that).</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">g++</span> <span class="at">-O3</span> <span class="at">-std</span><span class="op">=</span>c++11 fuuko.c <span class="at">-lm</span> <span class="at">-o</span> fuuko_cpp11</span>
|
||||
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> IOCCC <span class="kw">|</span> <span class="ex">./fuuko_cpp11</span> <span class="op">></span> output_cpp11.c</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> g++ -O3 -std=c++11 fuuko.c -lm -o fuuko_cpp11
|
||||
echo IOCCC | ./fuuko_cpp11 > output_cpp11.c</code></pre>
|
||||
<p>Don’t like any of these patterns? Use a C11 compiler and there will be
|
||||
no extra pattern.</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">-O3</span> <span class="at">-std</span><span class="op">=</span>c11 fuuko.c <span class="at">-lm</span> <span class="at">-o</span> fuuko_c11</span>
|
||||
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> IOCCC <span class="kw">|</span> <span class="ex">./fuuko_c11</span> <span class="op">></span> output_c11.c</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> cc -O3 -std=c11 fuuko.c -lm -o fuuko_c11
|
||||
echo IOCCC | ./fuuko_c11 > output_c11.c</code></pre>
|
||||
<p>Regardless of which of these C/C++ dialects you choose, the output
|
||||
will all be valid C90 code that reproduces original input on <code>stdout</code>,
|
||||
filled with pointer dereferences (C stars).</p>
|
||||
|
||||
Reference in new issue
Block a user