highlighting
This commit is contained in:
parent
4c775286ef
commit
7e898e720b
7 changed files with 44 additions and 12 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
**/serve/
|
**/serve/
|
||||||
**/soupault.toml
|
**/soupault.toml
|
||||||
|
css/code.css
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
[index]
|
[index]
|
||||||
index = true
|
index = true
|
||||||
# sort_descending = true
|
# sort_descending = true
|
||||||
|
|
9
build.sh
9
build.sh
|
@ -1,10 +1,15 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
function soup_config {
|
function soup_config {
|
||||||
cat ../soupault.toml > soupault.toml
|
rm soupault.toml
|
||||||
|
cp ../soupault.toml soupault.toml
|
||||||
cat soupault.toml.frag* >> 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
|
builtin pushd acl.cool
|
||||||
rm -rf serve/
|
rm -rf serve/
|
||||||
soup_config
|
soup_config
|
||||||
|
|
|
@ -2,4 +2,6 @@
|
||||||
|
|
||||||
@import url(looks.css);
|
@import url(looks.css);
|
||||||
|
|
||||||
@import url(layout.css);
|
@import url(layout.css);
|
||||||
|
|
||||||
|
@import url(code.css);
|
|
@ -12,7 +12,6 @@ code {
|
||||||
font-variant-ligatures: no-contextual;
|
font-variant-ligatures: no-contextual;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
code:not(pre code) {
|
code:not(pre code) {
|
||||||
background-color: var(--wide-gray);
|
background-color: var(--wide-gray);
|
||||||
padding-left: 3px;
|
padding-left: 3px;
|
||||||
|
@ -30,10 +29,10 @@ code:not(pre code) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
|
color: black;
|
||||||
background-color: var(--wide-gray);
|
background-color: var(--wide-gray);
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
color: black;
|
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
border-width: 2px;
|
border-width: 2px;
|
||||||
border-color: var(--wide-gray);
|
border-color: var(--wide-gray);
|
||||||
|
@ -45,7 +44,7 @@ pre {
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background-color: rgb(255, 255, 255);
|
background-color: rgb(255, 255, 255);
|
||||||
color: var(--middle-color);
|
/* color: var(--middle-color); */
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
|
@ -173,4 +172,4 @@ hr {
|
||||||
height: 2px;
|
height: 2px;
|
||||||
border: none;
|
border: none;
|
||||||
background-color: var(--narrow-gray);
|
background-color: var(--narrow-gray);
|
||||||
}
|
}
|
||||||
|
|
25
deps.sh
Executable file
25
deps.sh
Executable 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
|
|
@ -136,8 +136,7 @@ selector = "blink"
|
||||||
# but you can set this option to false to delete just the first one
|
# but you can set this option to false to delete just the first one
|
||||||
delete_all = true
|
delete_all = true
|
||||||
|
|
||||||
# [widgets.syntax]
|
[widgets.syntax]
|
||||||
# widget = "preprocess_element"
|
widget = "preprocess_element"
|
||||||
# selector = 'pre code'
|
selector = 'pre code'
|
||||||
# # command = "echo \"<code>$(awk -F \\- '{print $NF}' <<< $ATTR_CLASS)</code>\""
|
command = "pygmentize -l \"$(awk -F \\- '{print $NF}' <<< $ATTR_CLASS)\" -f html | head -c -13 | awk -F '<pre>' '{print $NF}'"
|
||||||
# command = 'highlight -O html -f --inline-css --syntax=ocaml --style=zellner'
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue