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,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make all
|
||||
```
|
||||
|
||||
@@ -19,13 +19,13 @@ For more detailed information see [1992 adrian bugs](../../bugs.html#1992_adrian
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
For the slow minded, try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./adsleep 32767
|
||||
```
|
||||
|
||||
@@ -134,7 +134,7 @@ character list.
|
||||
With the automaton specification in `filename`, invoke the program by
|
||||
typing
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./adrian filename
|
||||
```
|
||||
|
||||
@@ -151,7 +151,7 @@ occurs if your automaton has more than 257 states.
|
||||
|
||||
Running:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./adrian from < your_mailbox
|
||||
```
|
||||
|
||||
@@ -169,7 +169,7 @@ the regular expression:
|
||||
|
||||
I suggest using `adrian.c` as input, and storing the output in `adwc.c`:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./adrian < adrian.c > adwc.c
|
||||
```
|
||||
|
||||
@@ -181,13 +181,13 @@ in the input file.
|
||||
Another possibly interesting automaton can be created by slightly
|
||||
adjusting the `adrian.c` file. Change the first line to read
|
||||
|
||||
```c
|
||||
```<!---c-->
|
||||
/* . echo| . */
|
||||
```
|
||||
|
||||
and repeat the process above
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./adrian <adrian.c > adecho.c
|
||||
```
|
||||
|
||||
@@ -204,7 +204,7 @@ employed.
|
||||
Two other adjustments to the first line also yield useful results. By
|
||||
changing it to
|
||||
|
||||
```c
|
||||
```<!---c-->
|
||||
/* . head; . */
|
||||
```
|
||||
|
||||
@@ -221,7 +221,7 @@ specified (again this was changed to `__FILE__`).
|
||||
|
||||
By setting the first line to
|
||||
|
||||
```c
|
||||
```<!---c-->
|
||||
/* . basename . */
|
||||
```
|
||||
|
||||
@@ -240,7 +240,7 @@ The resulting base name is printed to stdout.
|
||||
|
||||
Lastly, by setting the first line to
|
||||
|
||||
```c
|
||||
```<!---c-->
|
||||
/* . sleep . */
|
||||
```
|
||||
|
||||
|
||||
+11
-11
@@ -141,16 +141,16 @@ 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> all</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make all</code></pre>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code> STATUS: known bug - please help us fix
|
||||
STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a href="../../bugs.html#1992_adrian">1992 adrian bugs</a>.</p>
|
||||
<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>For the slow minded, try:</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">./adsleep</span> 32767</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./adsleep 32767</code></pre>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>Once you get past the obfuscation, you have an opportunity to learn
|
||||
about regular expressions and state machines.</p>
|
||||
@@ -214,7 +214,7 @@ character list.</p>
|
||||
[q5]</code></pre>
|
||||
<p>With the automaton specification in <code>filename</code>, invoke the program by
|
||||
typing</p>
|
||||
<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">./adrian</span> filename</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./adrian filename</code></pre>
|
||||
<p>It will read the file and print out all the lines which the automaton
|
||||
accepts. If the file cannot be opened, a system error message will
|
||||
be printed. If the input contains errors, then an error message along
|
||||
@@ -225,7 +225,7 @@ being processed is printed. Error <code>no_destination</code> occurs if you spec
|
||||
set of characters, but no destination state, and error <code>too_many_states</code>
|
||||
occurs if your automaton has more than 257 states.</p>
|
||||
<p>Running:</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">./adrian</span> from <span class="op"><</span> your_mailbox</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./adrian from < your_mailbox</code></pre>
|
||||
<p>will perform a function similar to that of the unix <code>from</code> command.</p>
|
||||
<p>If no filename is specified on the command line, then <code>__FILE__</code> is used as the
|
||||
specification for the automaton. (Originally this was <code>"adgrep.c"</code> but the file
|
||||
@@ -234,23 +234,23 @@ changed to <code>__FILE__</code>.) In this case, the program will search for mat
|
||||
the regular expression:</p>
|
||||
<pre><code> ^.[^|C][^w[Q]*(Q|[w[]c).*|^.[C|]$</code></pre>
|
||||
<p>I suggest using <code>adrian.c</code> as input, and storing the output in <code>adwc.c</code>:</p>
|
||||
<div class="sourceCode" id="cb15"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./adrian</span> <span class="op"><</span> adrian.c <span class="op">></span> adwc.c</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./adrian < adrian.c > adwc.c</code></pre>
|
||||
<p>Compiling the new file, <code>adwc.c</code>, yields a clone of the unix <code>wc</code> command. It
|
||||
runs on one file, defaulting to <code>"adrian.c"</code> if no file is given (again, this
|
||||
was changed to be <code>__FILE__</code>) and displays the number of lines, words, and bytes
|
||||
in the input file.</p>
|
||||
<p>Another possibly interesting automaton can be created by slightly
|
||||
adjusting the <code>adrian.c</code> file. Change the first line to read</p>
|
||||
<div class="sourceCode" id="cb16"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a> <span class="co">/* . echo| . */</span></span></code></pre></div>
|
||||
<pre class="<!---c-->"><code> /* . echo| . */</code></pre>
|
||||
<p>and repeat the process above</p>
|
||||
<div class="sourceCode" id="cb17"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./adrian</span> <span class="op"><</span>adrian.c <span class="op">></span> adecho.c</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./adrian <adrian.c > adecho.c</code></pre>
|
||||
<p>The new file now contains all lines which match</p>
|
||||
<pre><code> ^.[^5|m^]*[m^]([e=p,;]|[^e=+p,;].*)$</code></pre>
|
||||
<p>Compile and run. This is an <code>echo(1)</code> clone. Note the efficient algorithm
|
||||
employed.</p>
|
||||
<p>Two other adjustments to the first line also yield useful results. By
|
||||
changing it to</p>
|
||||
<div class="sourceCode" id="cb19"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a> <span class="co">/* . head; . */</span></span></code></pre></div>
|
||||
<pre class="<!---c-->"><code> /* . head; . */</code></pre>
|
||||
<p>you can search for matches to</p>
|
||||
<pre><code> ^.[^W]*W..*$</code></pre>
|
||||
<p>By some freak happenstance, lines of <code>adrian.c</code> which match this regular
|
||||
@@ -258,7 +258,7 @@ expression form a unix <code>head(1)</code> command. It prints the first ten lin
|
||||
the file specified on the command line or <code>adrian.c</code> if no file is
|
||||
specified (again this was changed to <code>__FILE__</code>).</p>
|
||||
<p>By setting the first line to</p>
|
||||
<div class="sourceCode" id="cb21"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a> <span class="co">/* . basename . */</span></span></code></pre></div>
|
||||
<pre class="<!---c-->"><code> /* . basename . */</code></pre>
|
||||
<p>a clone of the unix <code>basename(1)</code> command can be unearthed. The automaton will
|
||||
search for</p>
|
||||
<pre><code> ^.[^j]*jr.*$</code></pre>
|
||||
@@ -268,7 +268,7 @@ filename, and the second, an extension. All leading pathname components
|
||||
are removed from the filename, and the extension is removed if present.
|
||||
The resulting base name is printed to stdout.</p>
|
||||
<p>Lastly, by setting the first line to</p>
|
||||
<div class="sourceCode" id="cb23"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a> <span class="co">/* . sleep . */</span></span></code></pre></div>
|
||||
<pre class="<!---c-->"><code> /* . sleep . */</code></pre>
|
||||
<p>you can search for</p>
|
||||
<pre><code> ^.[^(~][^s]*sl.*$</code></pre>
|
||||
<p>Filtering <code>adrian.c</code> through this search yields a clone of the <code>sleep(1)</code>
|
||||
|
||||
Reference in new issue
Block a user