Set syntax highlighting theme

This commit is contained in:
jultty 2024-02-24 12:51:40 -03:00
commit 92464824b1
3 changed files with 48 additions and 45 deletions

View file

@ -55,5 +55,5 @@ li {
.sourceCode pre {
color: #ccc;
margin-left: 20px;
padding: 20px;
}

View file

@ -1,6 +1,7 @@
#!/usr/bin/env utop
let pandoc_params = "--css ../../assets/style.css -s --to html5 --metadata pagetitle='basename' "
let pandoc_params = "--css ../../assets/style.css -s --to html5 " ^
"--metadata pagetitle='basename' --highlight-style zenburn "
let vert md = begin
if md <> "gen.ml" && md <> "html" then

View file

@ -38,43 +38,42 @@
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ }
{ color: #cccccc; background-color: #303030; }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { color: #008000; } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.al { color: #ffcfaf; } /* Alert */
code span.an { color: #7f9f7f; font-weight: bold; } /* Annotation */
code span.at { } /* Attribute */
code span.bn { color: #dca3a3; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #f0dfaf; } /* ControlFlow */
code span.ch { color: #dca3a3; } /* Char */
code span.cn { color: #dca3a3; font-weight: bold; } /* Constant */
code span.co { color: #7f9f7f; } /* Comment */
code span.cv { color: #7f9f7f; font-weight: bold; } /* CommentVar */
code span.do { color: #7f9f7f; } /* Documentation */
code span.dt { color: #dfdfbf; } /* DataType */
code span.dv { color: #dcdccc; } /* DecVal */
code span.er { color: #c3bf9f; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { color: #008000; font-weight: bold; } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
code span.fl { color: #c0bed1; } /* Float */
code span.fu { color: #efef8f; } /* Function */
code span.im { } /* Import */
code span.in { color: #7f9f7f; font-weight: bold; } /* Information */
code span.kw { color: #f0dfaf; } /* Keyword */
code span.op { color: #f0efd0; } /* Operator */
code span.ot { color: #efef8f; } /* Other */
code span.pp { color: #ffcfaf; font-weight: bold; } /* Preprocessor */
code span.sc { color: #dca3a3; } /* SpecialChar */
code span.ss { color: #cc9393; } /* SpecialString */
code span.st { color: #cc9393; } /* String */
code span.va { } /* Variable */
code span.vs { color: #cc9393; } /* VerbatimString */
code span.wa { color: #7f9f7f; font-weight: bold; } /* Warning */
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<link rel="stylesheet" href="../../assets/style.css" />
@ -91,17 +90,20 @@ propenso a erros. O que me incomodava mesmo era ver que todo aquele
tempo escrevendo scripts com Bash poderia ser tempo aprendendo uma
linguagem cujo conhecimento se transferisse para muitas outras
aplicações.</p>
<p>O script consiste nestas nove linhas apenas:</p>
<p>O script se resume a:</p>
<div class="sourceCode" id="cb1"><pre
class="sourceCode ocaml"><code class="sourceCode ocaml"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="kw">let</span> pandoc_params = <span class="st">&quot;--css ../../assets/style.css -s --to html5 --metadata pagetitle=&#39;basename&#39; &quot;</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="kw">let</span> vert md = <span class="kw">begin</span></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a> <span class="kw">if</span> md &lt;&gt; <span class="st">&quot;gen.ml&quot;</span> &amp;&amp; md &lt;&gt; <span class="st">&quot;html&quot;</span> <span class="kw">then</span></span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">ignore</span>( <span class="dt">Sys</span>.command (<span class="st">&quot;pandoc &quot;</span> ^ pandoc_params ^ md ^ <span class="st">&quot; -o html/&quot;</span> ^ md ^ <span class="st">&quot;.html &quot;</span>) )</span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span> ;;</span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a><span class="kw">let</span> contents = <span class="dt">Array</span>.to_list (<span class="dt">Sys</span>.readdir <span class="st">&quot;.&quot;</span>) <span class="kw">in</span></span>
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a><span class="dt">List</span>.map vert contents ;;</span></code></pre></div>
class="sourceCode ocaml"><code class="sourceCode ocaml"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="kw">let</span> pandoc_params = </span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;--css ../../assets/style.css -s --to html5 --metadata pagetitle=&#39;basename&#39; &quot;</span></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="kw">let</span> vert md = <span class="kw">begin</span></span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a> <span class="kw">if</span> md &lt;&gt; <span class="st">&quot;gen.ml&quot;</span> &amp;&amp; md &lt;&gt; <span class="st">&quot;html&quot;</span> <span class="kw">then</span></span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a> <span class="dt">ignore</span>( <span class="dt">Sys</span>.command (</span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;pandoc &quot;</span> ^ pandoc_params ^ md ^ <span class="st">&quot; -o html/&quot;</span> ^ md ^ <span class="st">&quot;.html &quot;</span></span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a> ) )</span>
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span> ;;</span>
<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a><span class="kw">let</span> contents = <span class="dt">Array</span>.to_list (<span class="dt">Sys</span>.readdir <span class="st">&quot;.&quot;</span>) <span class="kw">in</span></span>
<span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a><span class="dt">List</span>.map vert contents ;;</span></code></pre></div>
<p>Primeiro, armazeno em <code>pandoc_params</code> os parâmetros comuns
que serão passados ao Pandoc para gerar os arquivos HTML a partir dos
arquivos em Markdown.</p>
@ -113,11 +115,11 @@ arquivos de entrada e saída.</p>
a cada arquivo do diretório atual.</p>
<h2 id="referências">Referências</h2>
<ul>
<li><a href="https://jez.io/pandoc-markdown-css-theme/">Pandoc Markdown
CSS Theme</a></li>
<li><a
href="https://rosettacode.org/wiki/Walk_a_directory/Non-recursively#OCaml">Walk
a directory/Non-recursively - Rosetta Code</a></li>
<li><a href="https://jez.io/pandoc-markdown-css-theme/">Pandoc Markdown
CSS Theme</a></li>
</ul>
</body>
</html>