From 92464824b1df1195ae8901b6444fd6527a981376 Mon Sep 17 00:00:00 2001
From: jultty
Date: Sat, 24 Feb 2024 12:51:40 -0300
Subject: [PATCH] Set syntax highlighting theme
---
assets/style.css | 2 +-
posts/gen.ml | 3 +-
posts/html/scripts-em-ocaml.md.html | 88 +++++++++++++++--------------
3 files changed, 48 insertions(+), 45 deletions(-)
diff --git a/assets/style.css b/assets/style.css
index aaec4d7..22d4024 100644
--- a/assets/style.css
+++ b/assets/style.css
@@ -55,5 +55,5 @@ li {
.sourceCode pre {
color: #ccc;
- margin-left: 20px;
+ padding: 20px;
}
diff --git a/posts/gen.ml b/posts/gen.ml
index 4a57b22..a561f49 100755
--- a/posts/gen.ml
+++ b/posts/gen.ml
@@ -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
diff --git a/posts/html/scripts-em-ocaml.md.html b/posts/html/scripts-em-ocaml.md.html
index 08f6aaa..299526d 100644
--- a/posts/html/scripts-em-ocaml.md.html
+++ b/posts/html/scripts-em-ocaml.md.html
@@ -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;}
@@ -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.
-O script consiste nestas nove linhas apenas:
+O script se resume a:
let pandoc_params = "--css ../../assets/style.css -s --to html5 --metadata pagetitle='basename' "
-
-let vert md = begin
- if md <> "gen.ml" && md <> "html" then
- ignore( Sys.command ("pandoc " ^ pandoc_params ^ md ^ " -o html/" ^ md ^ ".html ") )
-end ;;
-
-let contents = Array.to_list (Sys.readdir ".") in
-List.map vert contents ;;
+class="sourceCode ocaml">let pandoc_params =
+ "--css ../../assets/style.css -s --to html5 --metadata pagetitle='basename' "
+
+let vert md = begin
+ if md <> "gen.ml" && md <> "html" then
+ ignore( Sys.command (
+ "pandoc " ^ pandoc_params ^ md ^ " -o html/" ^ md ^ ".html "
+ ) )
+end ;;
+
+let contents = Array.to_list (Sys.readdir ".") in
+List.map vert contents ;;
Primeiro, armazeno em pandoc_params os parâmetros comuns
que serão passados ao Pandoc para gerar os arquivos HTML a partir dos
arquivos em Markdown.
@@ -113,11 +115,11 @@ arquivos de entrada e saída.
a cada arquivo do diretório atual.
Referências