improved indentation and whitespace for markdown code blocks
All code blocks in markdown have been intended by at least 4 spaces. We add `--tab-stop=8` to all `pandoc(1)` executions in order to set a better tab stop indentation, especially for tab intended code blocks. Changed `bin/pandoc-wrapper.sh` VERSION from "1.5.3 2024-03-26" to "1.6 2024-03-31". Fixed `1991/brnstnd/sorta.README.md` so that the sorta code is code blocks. Removed unneeded paragraph group in copyright in `inc/footer.default.html`. Fixed excess whitespace after list Author on entry `index.html` page. Changed `bin/output-index-author.sh` VERSION from "1.5.2 2024-03-26" to "1.6 2024-03-31". Performed `make www` to perform the above and test under macOS. TODO: Fix the problem of the initial line of code being extra intended. TODO: Fix excess whitespace around code that is inline.
This commit is contained in:
1 parent
b84c27ce02
commit
a996f8d2b8
734 files changed
+16723
-16963
No files matched your search
+20
-21
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Ilya_Kurdyukov">Ilya Kurdyukov</a><br>
|
||||
Location: <a href="../../location.html#RU">RU</a> - <em>Russian Federation</em> (<em>Russia</em>)
|
||||
<br><br></li>
|
||||
Location: <a href="../../location.html#RU">RU</a> - <em>Russian Federation</em> (<em>Russia</em>)</li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||||
@@ -142,16 +141,16 @@ Location: <a href="../../location.html#RU">RU</a> - <em>Russian Federation</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></span></code></pre></div>
|
||||
<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>
|
||||
<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">./prog</span></span></code></pre></div>
|
||||
<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">./prog</span></span></code></pre></div>
|
||||
<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="co"># Take a selfie</span></span>
|
||||
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./prog</span> 1000 selfie.jpg output.jpg</span>
|
||||
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="co"># Admire your portrait in cubist style</span></span>
|
||||
<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="co"># Take a selfie</span></span>
|
||||
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> 1000 selfie.jpg output.jpg</span>
|
||||
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a> <span class="co"># Admire your portrait in cubist style</span></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="co"># Also try:</span></span>
|
||||
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
|
||||
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a> <span class="co"># Also try:</span></span>
|
||||
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>This entry has reminded us of a winning entry back in the early 90s. Can you
|
||||
guess which one?</p>
|
||||
@@ -162,7 +161,7 @@ rectangles. What is the complexity? Is it obvious from the source code?</p>
|
||||
<p>This program divides the image into a specified number of rectangles. This
|
||||
process is content aware, so the algorithm tries to match most of the information.
|
||||
However, it doesn’t find the best theoretically possible layout.</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">./prog</span> 1000 input.jpg output.jpg</span></code></pre></div>
|
||||
<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">./prog</span> 1000 input.jpg output.jpg</span></code></pre></div>
|
||||
<h3 id="building">Building</h3>
|
||||
<p>You can build three versions, depending on the image format.</p>
|
||||
<p>Default is JPEG version; if you have the <code>libjpeg</code> development package installed
|
||||
@@ -170,32 +169,32 @@ in your system, then <code>make</code> without arguments should do the right thi
|
||||
<p>If you want to use <code>libjpeg</code> compiled from sources, then use the <code>LIBJPEG</code> define to
|
||||
specify the path to includes and the library. For example using
|
||||
<a href="https://mac-dev-env.patrickbougie.com/libjpeg/">libjpeg source</a> version 9c:</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="fu">make</span> prog LIBJPEG=<span class="st">"-Ijpeg-9c jpeg-9c/libjpeg.a"</span></span></code></pre></div>
|
||||
<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="fu">make</span> prog LIBJPEG=<span class="st">"-Ijpeg-9c jpeg-9c/libjpeg.a"</span></span></code></pre></div>
|
||||
<p>Use this command to build a PNG version (you need <code>libpng</code>):</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">make</span> prog_png LIBPNG=<span class="st">"-lpng"</span></span></code></pre></div>
|
||||
<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">make</span> prog_png LIBPNG=<span class="st">"-lpng"</span></span></code></pre></div>
|
||||
<p>And the PPM version (no additional dependencies, can read raw/ASCII PPM, writes
|
||||
raw PPM):</p>
|
||||
<pre><code>make prog_ppm</code></pre>
|
||||
<pre><code> make prog_ppm</code></pre>
|
||||
<h3 id="building-on-macos-with-macports">Building on macOS with MacPorts:</h3>
|
||||
<p>Thanks to <a href="../../authors.html#Cody_Boone_Ferguson">Cody Boone Ferguson</a> for this
|
||||
information!</p>
|
||||
<p>First, make sure you have the compiler tools installed e.g. by:</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="fu">sudo</span> xcode-select <span class="at">--install</span></span></code></pre></div>
|
||||
<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="fu">sudo</span> xcode-select <span class="at">--install</span></span></code></pre></div>
|
||||
<p>Make sure you install <a href="https://www.macports.org/install.php">MacPorts</a>. Then do:</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="fu">sudo</span> port install jpeg libpng ImageMagick</span></code></pre></div>
|
||||
<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="fu">sudo</span> port install jpeg libpng ImageMagick</span></code></pre></div>
|
||||
<p>The program itself doesn’t need ImageMagick, install it only if you plan to make
|
||||
GIFs from the results using <code>makegif.sh</code>.</p>
|
||||
<p>After that’s installed you need to run make with these options:</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">make</span> LDFLAGS=<span class="st">"-I/opt/local/include -L/opt/local/lib"</span></span></code></pre></div>
|
||||
<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">make</span> LDFLAGS=<span class="st">"-I/opt/local/include -L/opt/local/lib"</span></span></code></pre></div>
|
||||
<h3 id="building-on-macos-with-homebrew">Building on macOS with Homebrew</h3>
|
||||
<p>First, make sure you have the compiler tools installed e.g. by:</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="fu">sudo</span> xcode-select <span class="at">--install</span></span></code></pre></div>
|
||||
<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="fu">sudo</span> xcode-select <span class="at">--install</span></span></code></pre></div>
|
||||
<p>Make sure you install <a href="https://brew.sh">Homebrew</a>.</p>
|
||||
<p>Then:</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">brew</span> install libjpeg libpng</span>
|
||||
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a><span class="bu">eval</span> <span class="st">"</span><span class="va">$(</span><span class="ex">brew</span> shellenv<span class="va">)</span><span class="st">"</span></span></code></pre></div>
|
||||
<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">brew</span> install libjpeg libpng</span>
|
||||
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">eval</span> <span class="st">"</span><span class="va">$(</span><span class="ex">brew</span> shellenv<span class="va">)</span><span class="st">"</span></span></code></pre></div>
|
||||
<p>You are now ready to compile this entry:</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="fu">make</span> clobber all</span></code></pre></div>
|
||||
<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="fu">make</span> clobber all</span></code></pre></div>
|
||||
<h3 id="notes">Notes</h3>
|
||||
<p>Made this thing while experimenting with the idea of representing an image with
|
||||
rectangles (lossy compression). It’s not very good in that sense, but the
|
||||
@@ -207,7 +206,7 @@ the picture data is split (halves may have different size) horizontally or
|
||||
vertically to get the minimum difference.</p>
|
||||
<p>You can use this command to make a GIF from output images (uses ImageMagick).
|
||||
For instance after running the command suggested by the judges:</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">convert</span> <span class="at">-delay</span> 10 <span class="at">-dither</span> none <span class="at">-loop</span> 0 <span class="va">$(</span><span class="fu">find</span> . <span class="at">-maxdepth</span> 1 <span class="at">-type</span> f <span class="at">-name</span> <span class="st">'*jpg'</span> <span class="kw">|</span> <span class="fu">sort</span> <span class="at">-V</span><span class="va">)</span> <span class="va">$(</span><span class="fu">find</span> . <span class="at">-maxdepth</span> 1 <span class="at">-type</span> f <span class="at">-name</span> <span class="st">'*jpg'</span> <span class="kw">|</span> <span class="fu">sort</span> <span class="at">-rV</span><span class="va">)</span> +map out.gif</span></code></pre></div>
|
||||
<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">convert</span> <span class="at">-delay</span> 10 <span class="at">-dither</span> none <span class="at">-loop</span> 0 <span class="va">$(</span><span class="fu">find</span> . <span class="at">-maxdepth</span> 1 <span class="at">-type</span> f <span class="at">-name</span> <span class="st">'*jpg'</span> <span class="kw">|</span> <span class="fu">sort</span> <span class="at">-V</span><span class="va">)</span> <span class="va">$(</span><span class="fu">find</span> . <span class="at">-maxdepth</span> 1 <span class="at">-type</span> f <span class="at">-name</span> <span class="st">'*jpg'</span> <span class="kw">|</span> <span class="fu">sort</span> <span class="at">-rV</span><span class="va">)</span> +map out.gif</span></code></pre></div>
|
||||
<p>NOTE: the above is done in the <a href="try.sh">try.sh</a> script.</p>
|
||||
<p>Also provided <code>makegif.sh</code> to aid with GIF creation.</p>
|
||||
<!--
|
||||
|
||||
Reference in new issue
Block a user