highlighting

This commit is contained in:
Alexander 2025-06-14 11:16:36 -04:00
parent 4c775286ef
commit 7e898e720b
7 changed files with 44 additions and 12 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
**/serve/
**/soupault.toml
css/code.css

View file

@ -1,3 +1,4 @@
[index]
index = true
# sort_descending = true

View file

@ -1,10 +1,15 @@
#!/bin/sh
#!/bin/bash
function soup_config {
cat ../soupault.toml > soupault.toml
rm soupault.toml
cp ../soupault.toml soupault.toml
cat soupault.toml.frag* >> soupault.toml
}
rm css/code.css
pygmentize -f html -S algol_nu | grep -v 'line-height' > css/code.css
builtin pushd acl.cool
rm -rf serve/
soup_config

View file

@ -2,4 +2,6 @@
@import url(looks.css);
@import url(layout.css);
@import url(layout.css);
@import url(code.css);

View file

@ -12,7 +12,6 @@ code {
font-variant-ligatures: no-contextual;
}
code:not(pre code) {
background-color: var(--wide-gray);
padding-left: 3px;
@ -30,10 +29,10 @@ code:not(pre code) {
}
pre {
color: black;
background-color: var(--wide-gray);
overflow-x: auto;
border-style: solid;
color: black;
border-radius: 3px;
border-width: 2px;
border-color: var(--wide-gray);
@ -45,7 +44,7 @@ pre {
body {
background-color: rgb(255, 255, 255);
color: var(--middle-color);
/* color: var(--middle-color); */
}
h1 {
@ -173,4 +172,4 @@ hr {
height: 2px;
border: none;
background-color: var(--narrow-gray);
}
}

25
deps.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/sh
which dnf 2> /dev/null
if [[ $? == 0 ]]; then
sudo dnf install python3-pygments
else
echo 'failed to install pygments with dnf' >&2
exit 1
fi
which opam 2> /dev/null
if [[ $? == 0 ]]; then
opam install -y soupault
else
echo 'failed to install soupault with opam' >&2
exit 2
fi
which cargo 2> /dev/null
if [[ $? == 0 ]]; then
cargo install jotdown
else
echo 'failed to install jotdown with cargo'
exit 3
fi

View file

@ -136,8 +136,7 @@ selector = "blink"
# but you can set this option to false to delete just the first one
delete_all = true
# [widgets.syntax]
# widget = "preprocess_element"
# selector = 'pre code'
# # command = "echo \"<code>$(awk -F \\- '{print $NF}' <<< $ATTR_CLASS)</code>\""
# command = 'highlight -O html -f --inline-css --syntax=ocaml --style=zellner'
[widgets.syntax]
widget = "preprocess_element"
selector = 'pre code'
command = "pygmentize -l \"$(awk -F \\- '{print $NF}' <<< $ATTR_CLASS)\" -f html | head -c -13 | awk -F '<pre>' '{print $NF}'"