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
+15
-15
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -18,7 +18,7 @@ For more detailed information see [2019 yang bugs](../../bugs.html#2019_yang).
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./prog sample_input.txt a b c d
|
||||
|
||||
cat a
|
||||
@@ -35,7 +35,7 @@ For more detailed information see [2019 yang bugs](../../bugs.html#2019_yang).
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -52,7 +52,7 @@ output again.
|
||||
|
||||
Scramble/unscramble to single file:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./prog original.txt > scrambled.txt
|
||||
|
||||
./prog < scrambled.txt > unscrambled.txt
|
||||
@@ -60,7 +60,7 @@ Scramble/unscramble to single file:
|
||||
|
||||
Scramble/unscramble to multiple files:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./prog input.txt output1.txt output2.txt ...
|
||||
|
||||
cat output1.txt output2.txt ... | ./prog > unscrambled.txt
|
||||
@@ -68,7 +68,7 @@ Scramble/unscramble to multiple files:
|
||||
|
||||
Re-scramble:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./prog original.txt | ./prog - > scrambled1.txt
|
||||
./prog original.txt | ./prog - | ./prog - > scrambled2.txt
|
||||
./prog original.txt | ./prog - | ./prog - | ... > scrambled3.txt
|
||||
@@ -76,7 +76,7 @@ Re-scramble:
|
||||
|
||||
Scramble slowly:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./prog input.txt | ruby prog.c
|
||||
```
|
||||
|
||||
@@ -87,14 +87,14 @@ Input must be in UTF-8 encoding.
|
||||
This is a text scrambling utility. To scramble text, specify input file name as
|
||||
the first argument:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./prog input.txt > output.txt
|
||||
```
|
||||
|
||||
If original input file was small enough to fit in your terminal, you
|
||||
can simply use `cat` to unscramble the output text.
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
cat output.txt
|
||||
```
|
||||
|
||||
@@ -106,7 +106,7 @@ order. This effect is more visible if there is a delay after each character is
|
||||
printed. For convenience, a utility is included in the source to output
|
||||
characters slowly:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./prog input.txt | ruby prog.c
|
||||
```
|
||||
|
||||
@@ -114,14 +114,14 @@ Scrambling order is deterministic, but you can reshuffle the output by
|
||||
piping it through the same utility again, by specifying `-` as the
|
||||
first argument:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./prog input.txt | ./prog - | ./prog - | ...
|
||||
```
|
||||
|
||||
You can also split the input to multiple files, each getting a subset
|
||||
of the original input characters:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./prog input.txt output1.txt output2.txt ...
|
||||
cat output1.txt output2.txt ... > unscrambled.txt
|
||||
```
|
||||
@@ -138,7 +138,7 @@ positions to be misaligned. But fear not, this utility also includes
|
||||
unscrambling functionality. If no argument is specified, input will
|
||||
be read through `stdin` and unscrambled to `stdout`:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./prog < scrambled.txt > unscrambled.txt
|
||||
```
|
||||
|
||||
@@ -146,7 +146,7 @@ Where this is useful is that if you scramble the input to multiple
|
||||
files and unscramble each output file individually, those output
|
||||
files can be printed on transparencies and distributed separately.
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./prog input.txt output1.txt output2.txt output3.txt
|
||||
./prog < output1.txt > layer1.txt
|
||||
./prog < output2.txt > layer2.txt
|
||||
@@ -159,7 +159,7 @@ In other words, this is a utility for facilitating
|
||||
This utility can also be used just for removing trailing whitespaces
|
||||
and expanding tabs to 8 spaces.
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./prog input.txt | ./prog
|
||||
```
|
||||
|
||||
|
||||
+35
-35
@@ -141,52 +141,52 @@ 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>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a href="../../bugs.html#2019_yang">2019 yang 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">./prog</span> sample_input.txt a b c d</span>
|
||||
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">cat</span> a</span>
|
||||
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">cat</span> b</span>
|
||||
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">cat</span> c</span>
|
||||
<span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb3-9"><a href="#cb3-9" aria-hidden="true" tabindex="-1"></a> <span class="fu">cat</span> d</span>
|
||||
<span id="cb3-10"><a href="#cb3-10" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb3-11"><a href="#cb3-11" aria-hidden="true" tabindex="-1"></a> <span class="fu">cat</span> a b c d <span class="kw">|</span> <span class="ex">./prog</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./prog sample_input.txt a b c d
|
||||
|
||||
cat a
|
||||
|
||||
cat b
|
||||
|
||||
cat c
|
||||
|
||||
cat d
|
||||
|
||||
cat a b c d | ./prog</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>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>Do you understand how this program works? You may have to go over and over the
|
||||
output again.</p>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
<h3 id="summary">Summary:</h3>
|
||||
<p>Scramble/unscramble to single file:</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">./prog</span> original.txt <span class="op">></span> scrambled.txt</span>
|
||||
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="op"><</span> scrambled.txt <span class="op">></span> unscrambled.txt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./prog original.txt > scrambled.txt
|
||||
|
||||
./prog < scrambled.txt > unscrambled.txt</code></pre>
|
||||
<p>Scramble/unscramble to multiple files:</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">./prog</span> input.txt output1.txt output2.txt ...</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">cat</span> output1.txt output2.txt ... <span class="kw">|</span> <span class="ex">./prog</span> <span class="op">></span> unscrambled.txt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./prog input.txt output1.txt output2.txt ...
|
||||
|
||||
cat output1.txt output2.txt ... | ./prog > unscrambled.txt</code></pre>
|
||||
<p>Re-scramble:</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">./prog</span> original.txt <span class="kw">|</span> <span class="ex">./prog</span> <span class="at">-</span> <span class="op">></span> scrambled1.txt</span>
|
||||
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> original.txt <span class="kw">|</span> <span class="ex">./prog</span> <span class="at">-</span> <span class="kw">|</span> <span class="ex">./prog</span> <span class="at">-</span> <span class="op">></span> scrambled2.txt</span>
|
||||
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> original.txt <span class="kw">|</span> <span class="ex">./prog</span> <span class="at">-</span> <span class="kw">|</span> <span class="ex">./prog</span> <span class="at">-</span> <span class="kw">|</span> <span class="ex">...</span> <span class="op">></span> scrambled3.txt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./prog original.txt | ./prog - > scrambled1.txt
|
||||
./prog original.txt | ./prog - | ./prog - > scrambled2.txt
|
||||
./prog original.txt | ./prog - | ./prog - | ... > scrambled3.txt</code></pre>
|
||||
<p>Scramble slowly:</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">./prog</span> input.txt <span class="kw">|</span> <span class="ex">ruby</span> prog.c</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./prog input.txt | ruby prog.c</code></pre>
|
||||
<p>Input must be in UTF-8 encoding.</p>
|
||||
<h3 id="details">Details:</h3>
|
||||
<p>This is a text scrambling utility. To scramble text, specify input file name as
|
||||
the first argument:</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">./prog</span> input.txt <span class="op">></span> output.txt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./prog input.txt > output.txt</code></pre>
|
||||
<p>If original input file was small enough to fit in your terminal, you
|
||||
can simply use <code>cat</code> to unscramble the output text.</p>
|
||||
<div class="sourceCode" id="cb10"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">cat</span> output.txt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> cat output.txt</code></pre>
|
||||
<p>It might seem like nothing was scrambled, but you can try passing the output
|
||||
through <code>strings(1)</code> and see that most of the original strings are gone. What
|
||||
happened is that the original text has been shuffled with ANSI cursor
|
||||
@@ -194,15 +194,15 @@ positioning codes inserted in such a way that characters are printed in random
|
||||
order. This effect is more visible if there is a delay after each character is
|
||||
printed. For convenience, a utility is included in the source to output
|
||||
characters slowly:</p>
|
||||
<div class="sourceCode" id="cb11"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> input.txt <span class="kw">|</span> <span class="ex">ruby</span> prog.c</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./prog input.txt | ruby prog.c</code></pre>
|
||||
<p>Scrambling order is deterministic, but you can reshuffle the output by
|
||||
piping it through the same utility again, by specifying <code>-</code> as the
|
||||
first argument:</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">./prog</span> input.txt <span class="kw">|</span> <span class="ex">./prog</span> <span class="at">-</span> <span class="kw">|</span> <span class="ex">./prog</span> <span class="at">-</span> <span class="kw">|</span> <span class="ex">...</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./prog input.txt | ./prog - | ./prog - | ...</code></pre>
|
||||
<p>You can also split the input to multiple files, each getting a subset
|
||||
of the original input characters:</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">./prog</span> input.txt output1.txt output2.txt ...</span>
|
||||
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">cat</span> output1.txt output2.txt ... <span class="op">></span> unscrambled.txt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./prog input.txt output1.txt output2.txt ...
|
||||
cat output1.txt output2.txt ... > unscrambled.txt</code></pre>
|
||||
<p>You can only unscramble files with <code>cat</code> if the input fits in a single
|
||||
terminal screen. If you don’t know what will be the terminal size of
|
||||
the recipient, note that <code>prog.c</code> will fit in a 80x25 terminal, so a
|
||||
@@ -213,19 +213,19 @@ sufficient for unscrambling because any scrolling causes the character
|
||||
positions to be misaligned. But fear not, this utility also includes
|
||||
unscrambling functionality. If no argument is specified, input will
|
||||
be read through <code>stdin</code> and unscrambled to <code>stdout</code>:</p>
|
||||
<div class="sourceCode" id="cb14"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="op"><</span> scrambled.txt <span class="op">></span> unscrambled.txt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./prog < scrambled.txt > unscrambled.txt</code></pre>
|
||||
<p>Where this is useful is that if you scramble the input to multiple
|
||||
files and unscramble each output file individually, those output
|
||||
files can be printed on transparencies and distributed separately.</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">./prog</span> input.txt output1.txt output2.txt output3.txt</span>
|
||||
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="op"><</span> output1.txt <span class="op">></span> layer1.txt</span>
|
||||
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="op"><</span> output2.txt <span class="op">></span> layer2.txt</span>
|
||||
<span id="cb15-4"><a href="#cb15-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="op"><</span> output3.txt <span class="op">></span> layer3.txt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./prog input.txt output1.txt output2.txt output3.txt
|
||||
./prog < output1.txt > layer1.txt
|
||||
./prog < output2.txt > layer2.txt
|
||||
./prog < output3.txt > layer3.txt</code></pre>
|
||||
<p>In other words, this is a utility for facilitating
|
||||
<a href="https://en.wikipedia.org/wiki/Visual_cryptography">visual cryptography</a>.</p>
|
||||
<p>This utility can also be used just for removing trailing whitespaces
|
||||
and expanding tabs to 8 spaces.</p>
|
||||
<div class="sourceCode" id="cb16"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> input.txt <span class="kw">|</span> <span class="ex">./prog</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./prog input.txt | ./prog</code></pre>
|
||||
<h3 id="features">Features:</h3>
|
||||
<h4 id="utf-8-support">UTF-8 support:</h4>
|
||||
<p>A simple text scrambling utility might not have required a screenful
|
||||
|
||||
Reference in new issue
Block a user