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,20 +1,20 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./akari [ input_file | - ] [ output_file | - ] [even]
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -56,7 +56,7 @@ keep odd pixels on odd [scanlines](https://en.wikipedia.org/wiki/Scan_line).
|
||||
|
||||
### Examples:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
gcc akari.c -o akari
|
||||
./akari < example.ppm > odd_output.ppm
|
||||
./akari - - even < example.ppm > even_output.ppm
|
||||
@@ -82,7 +82,7 @@ Anything that is not parsable as `PGM` or `PPM` will be downsampled as
|
||||
ASCII art. Since the source code is formatted as ASCII art, it's only
|
||||
natural to try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./akari akari.c akari2.c
|
||||
```
|
||||
|
||||
@@ -91,7 +91,7 @@ By default, this second program reads text from `stdin` and writes
|
||||
expanded output to `stdout`. If the extra argument is specified, the
|
||||
output text will also pass through a rot13 filter.
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
gcc akari2.c -o akari2
|
||||
./akari2 < input.txt > expanded_output.txt
|
||||
./akari2 rot13 < input.txt > expanded_and_rot13_output.txt
|
||||
@@ -100,20 +100,20 @@ output text will also pass through a rot13 filter.
|
||||
You can combine the two programs together to have just a regular rot13
|
||||
filter:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./akari2 rot13 < input.txt | ./akari > rot13.txt
|
||||
```
|
||||
|
||||
Of course, we wouldn't stop with just 2 programs, you can downsample
|
||||
the source *again* and get yet another C program:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./akari < akari.c | ./akari > akari3.c
|
||||
```
|
||||
|
||||
We must go deeper:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./akari < akari.c | ./akari | ./akari > akari4.c
|
||||
```
|
||||
|
||||
|
||||
+14
-14
@@ -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="ex">./akari</span> [ input_file <span class="kw">|</span> <span class="ex">-</span> ] [ output_file <span class="kw">|</span> <span class="ex">-</span> ] <span class="pp">[</span><span class="ss">even</span><span class="pp">]</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./akari [ input_file | - ] [ output_file | - ] [even]</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><code>Akari</code> is an image downsampling utility that accepts 3 input formats:</p>
|
||||
<ul>
|
||||
@@ -171,10 +171,10 @@ will read from <code>stdin</code>.</p>
|
||||
<a href="https://en.wikipedia.org/wiki/Scan_line">scanlines</a>. By default <code>Akari</code> will
|
||||
keep odd pixels on odd <a href="https://en.wikipedia.org/wiki/Scan_line">scanlines</a>.</p>
|
||||
<h3 id="examples">Examples:</h3>
|
||||
<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">gcc</span> akari.c <span class="at">-o</span> akari</span>
|
||||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./akari</span> <span class="op"><</span> example.ppm <span class="op">></span> odd_output.ppm</span>
|
||||
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./akari</span> <span class="at">-</span> <span class="at">-</span> even <span class="op"><</span> example.ppm <span class="op">></span> even_output.ppm</span>
|
||||
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">./akari</span> example.ppm odd_output.ppm</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> gcc akari.c -o akari
|
||||
./akari < example.ppm > odd_output.ppm
|
||||
./akari - - even < example.ppm > even_output.ppm
|
||||
./akari example.ppm odd_output.ppm</code></pre>
|
||||
<p><code>Akari</code> accepts 3 input formats:</p>
|
||||
<ul>
|
||||
<li><a href="https://netpbm.sourceforge.net/doc/pgm.html">PGM</a>
|
||||
@@ -192,22 +192,22 @@ the included <a href="example.ppm">example.ppm</a>.</p>
|
||||
<p>Anything that is not parsable as <code>PGM</code> or <code>PPM</code> will be downsampled as
|
||||
ASCII art. Since the source code is formatted as ASCII art, it’s only
|
||||
natural to try:</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="ex">./akari</span> akari.c akari2.c</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./akari akari.c akari2.c</code></pre>
|
||||
<p><code>akari2.c</code> is also a valid C program, and accepts up to 1 argument.
|
||||
By default, this second program reads text from <code>stdin</code> and writes
|
||||
expanded output to <code>stdout</code>. If the extra argument is specified, the
|
||||
output text will also pass through a rot13 filter.</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">gcc</span> akari2.c <span class="at">-o</span> akari2</span>
|
||||
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./akari2</span> <span class="op"><</span> input.txt <span class="op">></span> expanded_output.txt</span>
|
||||
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./akari2</span> rot13 <span class="op"><</span> input.txt <span class="op">></span> expanded_and_rot13_output.txt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> gcc akari2.c -o akari2
|
||||
./akari2 < input.txt > expanded_output.txt
|
||||
./akari2 rot13 < input.txt > expanded_and_rot13_output.txt</code></pre>
|
||||
<p>You can combine the two programs together to have just a regular rot13
|
||||
filter:</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">./akari2</span> rot13 <span class="op"><</span> input.txt <span class="kw">|</span> <span class="ex">./akari</span> <span class="op">></span> rot13.txt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./akari2 rot13 < input.txt | ./akari > rot13.txt</code></pre>
|
||||
<p>Of course, we wouldn’t stop with just 2 programs, you can downsample
|
||||
the source <em>again</em> and get yet another C program:</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="ex">./akari</span> <span class="op"><</span> akari.c <span class="kw">|</span> <span class="ex">./akari</span> <span class="op">></span> akari3.c</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./akari < akari.c | ./akari > akari3.c</code></pre>
|
||||
<p>We must go deeper:</p>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./akari</span> <span class="op"><</span> akari.c <span class="kw">|</span> <span class="ex">./akari</span> <span class="kw">|</span> <span class="ex">./akari</span> <span class="op">></span> akari4.c</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./akari < akari.c | ./akari | ./akari > akari4.c</code></pre>
|
||||
<p><code>akari3.c</code> and <code>akari4.c</code> are still (mostly valid) C programs.
|
||||
<code>gcc -Wall</code> will output a few warnings, but still produce output
|
||||
executables. The output executables each print a message to <code>stdout</code>.</p>
|
||||
|
||||
Reference in new issue
Block a user