diff --git a/.gitignore b/.gitignore index ebea711..c995049 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ **/serve/ **/soupault.toml +css/code.css diff --git a/acl.cool/soupault.toml.frag b/acl.cool/soupault.toml.frag index f10f925..6f2f1b9 100644 --- a/acl.cool/soupault.toml.frag +++ b/acl.cool/soupault.toml.frag @@ -1,3 +1,4 @@ + [index] index = true # sort_descending = true diff --git a/build.sh b/build.sh index e96102d..6ce8cae 100755 --- a/build.sh +++ b/build.sh @@ -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 diff --git a/css/index.css b/css/index.css index 9b35989..753f81a 100644 --- a/css/index.css +++ b/css/index.css @@ -2,4 +2,6 @@ @import url(looks.css); -@import url(layout.css); \ No newline at end of file +@import url(layout.css); + +@import url(code.css); \ No newline at end of file diff --git a/css/looks.css b/css/looks.css index 2cd9f6c..e88bab1 100644 --- a/css/looks.css +++ b/css/looks.css @@ -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); -} \ No newline at end of file +} diff --git a/deps.sh b/deps.sh new file mode 100755 index 0000000..c18135b --- /dev/null +++ b/deps.sh @@ -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 diff --git a/soupault.toml b/soupault.toml index 19906ea..a489b2d 100644 --- a/soupault.toml +++ b/soupault.toml @@ -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 \"$(awk -F \\- '{print $NF}' <<< $ATTR_CLASS)\"" -# 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 '
' '{print $NF}'"