cache supported lexers for pygments
This commit is contained in:
parent
af97adacbe
commit
fba9f88956
6 changed files with 10 additions and 5 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -6,3 +6,4 @@ all_chars.txt
|
||||||
**/fonts/**/*-Subset.*
|
**/fonts/**/*-Subset.*
|
||||||
woff2/
|
woff2/
|
||||||
**/serve_*
|
**/serve_*
|
||||||
|
/lexers.out
|
||||||
|
|
1
acl.cool/lexers.out
Symbolic link
1
acl.cool/lexers.out
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../lexers.out
|
5
build.sh
5
build.sh
|
@ -18,6 +18,11 @@ function soup_config {
|
||||||
|
|
||||||
source ./pgvv/bin/activate
|
source ./pgvv/bin/activate
|
||||||
|
|
||||||
|
if ! [[ -f lexers.out ]] || [[ "$(head -1 lexers.out)" != "$(pygmentize -V)" ]]; then
|
||||||
|
pygmentize -L lexer >lexers.out
|
||||||
|
echo "Created pygments lexer cache at lexers.out"
|
||||||
|
fi
|
||||||
|
|
||||||
find acl.cool/site/ ytheleus.org/site/ -type f \( -name '*.dj' -o -name '*.html' \) -exec cat {} + >all_chars.txt
|
find acl.cool/site/ ytheleus.org/site/ -type f \( -name '*.dj' -o -name '*.html' \) -exec cat {} + >all_chars.txt
|
||||||
cat common_chars.txt >>all_chars.txt
|
cat common_chars.txt >>all_chars.txt
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,6 @@
|
||||||
# Trying to process this config with an older version will result in an error message
|
# Trying to process this config with an older version will result in an error message
|
||||||
soupault_version = "4.11.0"
|
soupault_version = "4.11.0"
|
||||||
|
|
||||||
# Stop on page processing errors?
|
|
||||||
strict = true
|
|
||||||
|
|
||||||
# Display progress?
|
# Display progress?
|
||||||
verbose = true
|
verbose = true
|
||||||
|
|
||||||
|
@ -29,7 +26,7 @@ build_dir = "serve"
|
||||||
#
|
#
|
||||||
# Note that for formats other than HTML, you need to specify an external program
|
# Note that for formats other than HTML, you need to specify an external program
|
||||||
# for converting them to HTML (see below).
|
# for converting them to HTML (see below).
|
||||||
page_file_extensions = ["htm", "html", "md", "rst", "adoc", "dj"]
|
page_file_extensions = ["html", "dj"]
|
||||||
|
|
||||||
# By default, soupault uses "clean URLs",
|
# By default, soupault uses "clean URLs",
|
||||||
# that is, $site_dir/page.html is converted to $build_dir/page/index.html
|
# that is, $site_dir/page.html is converted to $build_dir/page/index.html
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#! /usr/bin/env sh
|
#! /usr/bin/env sh
|
||||||
|
|
||||||
if [ $# -lt 1 ] || ! pygmentize -L lexers | grep -qw "$1"; then
|
if [ $# -lt 1 ] || ! grep -qw "$1" lexers.out; then
|
||||||
recode utf8..html
|
recode utf8..html
|
||||||
else
|
else
|
||||||
pygmentize -l $1 -f html | head -c -13 | awk -F '<pre>' '{print $NF}'
|
pygmentize -l $1 -f html | head -c -13 | awk -F '<pre>' '{print $NF}'
|
||||||
|
|
1
ytheleus.org/lexers.out
Symbolic link
1
ytheleus.org/lexers.out
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../lexers.out
|
Loading…
Add table
Add a link
Reference in a new issue