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,13 +1,13 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make all
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./schweikh2
|
||||
```
|
||||
|
||||
@@ -24,19 +24,19 @@ The program accepts up to 4 parameters:
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
What happens if you pass only three parameters like the below?
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./schweikh2 15 1 0
|
||||
```
|
||||
|
||||
The author also suggests:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
while :; do grep -v '#' schweikh2.c; done
|
||||
```
|
||||
|
||||
@@ -51,7 +51,7 @@ The original program, with only slight obfuscations, may be found
|
||||
in [hunni.c](hunni.c). The perl script, [hunni.pl](hunni.pl), obfuscates it
|
||||
appropriately. Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
less hunni.c
|
||||
|
||||
perl ./hunni.pl < hunni.c
|
||||
@@ -137,7 +137,7 @@ minutes (`gcc -O3`).
|
||||
|
||||
### Sample arguments:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./schweikh2 6
|
||||
./schweikh2 7 0
|
||||
./schweikh2 7 7 0
|
||||
@@ -151,7 +151,7 @@ minutes (`gcc -O3`).
|
||||
The diamond pattern can be continued without a break.
|
||||
For a nice printout try this on your Bourne compatible shell:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
while :; do grep -v '#' schweikh2.c; done
|
||||
```
|
||||
|
||||
|
||||
+15
-15
@@ -141,9 +141,9 @@ Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germ
|
||||
<!-- 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> all</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make all</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">./schweikh2</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./schweikh2</code></pre>
|
||||
<p>The program accepts up to 4 parameters:</p>
|
||||
<ol start="0" type="1">
|
||||
<li><p>The number of operators in the expression [default: 9]</p></li>
|
||||
@@ -152,11 +152,11 @@ Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germ
|
||||
<li><p>The goal value or 0/0 [default: 42]</p></li>
|
||||
</ol>
|
||||
<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>
|
||||
<p>What happens if you pass only three parameters like the below?</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">./schweikh2</span> 15 1 0</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./schweikh2 15 1 0</code></pre>
|
||||
<p>The author also suggests:</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="cf">while</span> <span class="bu">:</span><span class="kw">;</span> <span class="cf">do</span> <span class="fu">grep</span> <span class="at">-v</span> <span class="st">'#'</span> schweikh2.c<span class="kw">;</span> <span class="cf">done</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> while :; do grep -v '#' schweikh2.c; done</code></pre>
|
||||
<p>(and we do too) which works with <code>sh</code>, <code>bash</code>, <code>ksh</code> and <code>zsh</code> as well. Press
|
||||
ctrl-c to stop it. Observe how the <a href="try.sh">try.sh</a> script does this once to
|
||||
make it easier to see what is happening.</p>
|
||||
@@ -164,9 +164,9 @@ make it easier to see what is happening.</p>
|
||||
<p>The original program, with only slight obfuscations, may be found
|
||||
in <a href="hunni.c">hunni.c</a>. The perl script, <a href="hunni.pl">hunni.pl</a>, obfuscates it
|
||||
appropriately. Try:</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="fu">less</span> hunni.c</span>
|
||||
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">perl</span> ./hunni.pl <span class="op"><</span> hunni.c</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> less hunni.c
|
||||
|
||||
perl ./hunni.pl < hunni.c</code></pre>
|
||||
<p>This entry was another crowd pleaser at the IOCCC BOF.</p>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
<p>Note: the source must be viewed with tabstop 8. To appreciate the
|
||||
@@ -230,16 +230,16 @@ operators but you will probably wait quite some time for every of the
|
||||
on a 50 MHz SPARC, <code>4^11</code> expressions are evaluated in about 3 cpu
|
||||
minutes (<code>gcc -O3</code>).</p>
|
||||
<h3 id="sample-arguments">Sample arguments:</h3>
|
||||
<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">./schweikh2</span> 6</span>
|
||||
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./schweikh2</span> 7 0</span>
|
||||
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./schweikh2</span> 7 7 0</span>
|
||||
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">./schweikh2</span> 8 9 <span class="at">-1</span> <span class="at">-67</span>/21</span>
|
||||
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a> <span class="ex">./schweikh2</span> 8 2 2/5 <span class="at">-98</span>/25</span>
|
||||
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a> <span class="ex">./schweikh2</span> 2 1/0 1 1/0</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./schweikh2 6
|
||||
./schweikh2 7 0
|
||||
./schweikh2 7 7 0
|
||||
./schweikh2 8 9 -1 -67/21
|
||||
./schweikh2 8 2 2/5 -98/25
|
||||
./schweikh2 2 1/0 1 1/0</code></pre>
|
||||
<h3 id="miscellaneous">Miscellaneous</h3>
|
||||
<p>The diamond pattern can be continued without a break.
|
||||
For a nice printout try this on your Bourne compatible shell:</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="cf">while</span> <span class="bu">:</span><span class="kw">;</span> <span class="cf">do</span> <span class="fu">grep</span> <span class="at">-v</span> <span class="st">'#'</span> schweikh2.c<span class="kw">;</span> <span class="cf">done</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> while :; do grep -v '#' schweikh2.c; done</code></pre>
|
||||
<!--
|
||||
|
||||
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
|
||||
|
||||
Reference in new issue
Block a user