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
+7
-7
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make all
|
||||
```
|
||||
|
||||
@@ -21,14 +21,14 @@ For more detailed information see [1992 gson bugs](../../bugs.html#1992_gson).
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./ag word word2 word3 < /path/to/dictionary
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -45,7 +45,7 @@ following locations though the last one is more ironic:
|
||||
|
||||
Then using the proper dictionary file it does:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./ag free software foundation < /usr/share/dict/words
|
||||
./ag obfuscated c contest < /usr/share/dict/words
|
||||
./ag unix international < /usr/share/dict/words
|
||||
@@ -73,7 +73,7 @@ weren't allowed to print!
|
||||
The author provided an obfuscated script that can be used to construct
|
||||
dictionaries which has been put in as [mkdict.sh](mkdict.sh). To use try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
cat README.md | ./mkdict.sh > words
|
||||
```
|
||||
|
||||
@@ -103,7 +103,7 @@ have one already, you can make your own dictionary by concatenating a few
|
||||
hundred of your favourite Usenet articles and piping them through the following
|
||||
obfuscated shell script:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
#!/bin/sh
|
||||
z=a-z];tr [A-Z\] \[$z|sed s/[\^$z[\^$z*/_/g|tr _ \\012|grep ..|sort -u
|
||||
```
|
||||
@@ -258,7 +258,7 @@ those bits that should remain zero. For example, the following
|
||||
program prints all those 16-bit integers that contain zeroes in all
|
||||
even bit positions:
|
||||
|
||||
```c
|
||||
```<!---c-->
|
||||
main(){int i=0,s=0xAAAA;do{printf("%04x\t",i);}while(i=((i|~s)+1)&s);}
|
||||
```
|
||||
|
||||
|
||||
+14
-14
@@ -141,7 +141,7 @@ Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </em
|
||||
<!-- 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>
|
||||
<p>NOTE: we DISABLE the optimiser because having it enabled causes some invocations
|
||||
to crash in some systems.</p>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
@@ -149,9 +149,9 @@ to crash in some systems.</p>
|
||||
<pre><code> STATUS: uses gets() - change to fgets() if possible</code></pre>
|
||||
<p>For more detailed information see <a href="../../bugs.html#1992_gson">1992 gson 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">./ag</span> word word2 word3 <span class="op"><</span> /path/to/dictionary</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./ag word word2 word3 < /path/to/dictionary</code></pre>
|
||||
<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>This script will determine (or try and determine) where your system dictionary
|
||||
is located and assuming that it can find one it’ll use that. It checks the
|
||||
following locations though the last one is more ironic:</p>
|
||||
@@ -160,13 +160,13 @@ following locations though the last one is more ironic:</p>
|
||||
/usr/ucblib/dict/words
|
||||
/dev/null # <-- for machines with nothing to say</code></pre>
|
||||
<p>Then using the proper dictionary file it does:</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">./ag</span> free software foundation <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./ag</span> obfuscated c contest <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./ag</span> unix international <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">./ag</span> george bush <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a> <span class="ex">./ag</span> bill clinton <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a> <span class="ex">./ag</span> ross perot <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a> <span class="ex">./ag</span> paul e tsongas <span class="op"><</span> /usr/share/dict/words</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./ag free software foundation < /usr/share/dict/words
|
||||
./ag obfuscated c contest < /usr/share/dict/words
|
||||
./ag unix international < /usr/share/dict/words
|
||||
./ag george bush < /usr/share/dict/words
|
||||
./ag bill clinton < /usr/share/dict/words
|
||||
./ag ross perot < /usr/share/dict/words
|
||||
./ag paul e tsongas < /usr/share/dict/words</code></pre>
|
||||
<p>where <code>/usr/share/dict/words</code> is the dictionary file.</p>
|
||||
<p>Then it uses the <a href="mkdict.sh">mkdict.sh</a> script to create a dictionary file out
|
||||
of the files <a href="README.md">README.md</a>, <a href="try.sh">try.sh</a> (itself) and
|
||||
@@ -179,7 +179,7 @@ names listed above. Run this program to find the anagrams they
|
||||
weren’t allowed to print!</p>
|
||||
<p>The author provided an obfuscated script that can be used to construct
|
||||
dictionaries which has been put in as <a href="mkdict.sh">mkdict.sh</a>. To use try:</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="fu">cat</span> README.md <span class="kw">|</span> <span class="ex">./mkdict.sh</span> <span class="op">></span> words</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> cat README.md | ./mkdict.sh > words</code></pre>
|
||||
<p>Then try using the program as shown above with the file <code>words</code>.</p>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
<p>The name of the game:</p>
|
||||
@@ -195,8 +195,8 @@ natural language of your choice, one word on each line. If your machine doesn’
|
||||
have one already, you can make your own dictionary by concatenating a few
|
||||
hundred of your favourite Usenet articles and piping them through the following
|
||||
obfuscated shell script:</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="co">#!/bin/sh</span></span>
|
||||
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a> <span class="va">z</span><span class="op">=</span>a-z]<span class="kw">;</span><span class="fu">tr</span> [A-Z<span class="dt">\]</span> <span class="dt">\[</span><span class="va">$z</span><span class="kw">|</span><span class="fu">sed</span> s/[<span class="dt">\^</span><span class="va">$z</span>[<span class="dt">\^</span><span class="va">$z</span><span class="pp">*</span>/_/g<span class="kw">|</span><span class="fu">tr</span> _ <span class="dt">\\</span>012<span class="kw">|</span><span class="fu">grep</span> ..<span class="kw">|</span><span class="fu">sort</span> <span class="at">-u</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> #!/bin/sh
|
||||
z=a-z];tr [A-Z\] \[$z|sed s/[\^$z[\^$z*/_/g|tr _ \\012|grep ..|sort -u</code></pre>
|
||||
<p>Using articles from alt.folklore.computers is likely to make
|
||||
a more professional-looking dictionary than rec.arts.erotica.</p>
|
||||
<p>AG must be run with the dictionary file as standard input.</p>
|
||||
@@ -323,7 +323,7 @@ the carries generated in incrementing <code>i</code> propagate straight across
|
||||
those bits that should remain zero. For example, the following
|
||||
program prints all those 16-bit integers that contain zeroes in all
|
||||
even bit positions:</p>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> main<span class="op">(){</span><span class="dt">int</span> i<span class="op">=</span><span class="dv">0</span><span class="op">,</span>s<span class="op">=</span><span class="bn">0xAAAA</span><span class="op">;</span><span class="cf">do</span><span class="op">{</span>printf<span class="op">(</span><span class="st">"</span><span class="sc">%04x\t</span><span class="st">"</span><span class="op">,</span>i<span class="op">);}</span><span class="cf">while</span><span class="op">(</span>i<span class="op">=((</span>i<span class="op">|~</span>s<span class="op">)+</span><span class="dv">1</span><span class="op">)&</span>s<span class="op">);}</span></span></code></pre></div>
|
||||
<pre class="<!---c-->"><code> main(){int i=0,s=0xAAAA;do{printf("%04x\t",i);}while(i=((i|~s)+1)&s);}</code></pre>
|
||||
<p>AG uses a similar method but works in the opposite direction, finding
|
||||
the next lower value with zeroes in given bit positions by propagating
|
||||
borrows across those bits. Some additional adjustments are made
|
||||
|
||||
Reference in new issue
Block a user