A static site generator that can put the toothpaste back in the tube.
git clone https://git.stjo.hn/squeeze
Log | Files | Refs | README | LICENSE

commit 4e0b847501f943769d593be6d5f6665a1494b8b8
parent 36e075c970751fc7efa2b0676a4548ac9328530d
Author: St John Karp <contact@stjo.hn>
Date:   Thu,  2 Apr 2020 11:03:39 -0500

Reinstate Smartypants

We need to do a second pass to smarten punctuation that may
occur in the template or the title. I'm not entirely happy with
this (or the slightly hacky handling of the headers with Pandoc),
but it works for now.

Mreadme.md | 3++-
Msqueeze.sh | 4+++-
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/readme.md b/readme.md @@ -14,7 +14,8 @@ It's pretty closely tailored to my specific needs, but it works, and IMHO it wor * Bash. Used to run the script that automates everything else. * A Prolog interpreter. Tested with [SWI-Prolog](https://www.swi-prolog.org/), but the syntax aims to be vanilla ISO Prolog and should work with any implementation. -* [Pandoc](http://pandoc.org/). Used to convert Markdown to HTML and smarten the punctuation. +* [Pandoc](http://pandoc.org/). Used to convert Markdown to HTML. +* [Smartypants](https://github.com/leohemsted/smartypants.py). Used to smarten the punctuation in the HTML output. ## Assumptions diff --git a/squeeze.sh b/squeeze.sh @@ -35,7 +35,9 @@ find "$SITE_PATH/$SOURCE_DIR" -type f -name "*.md" -print0 | pandoc --ascii --from markdown+smart --to html | # Recombine with the metadata and hand it to Prolog. (sed "/^$/q" "$file" && cat) | - swipl --traditional -q -l parse_entry.pl -g "consult('$SITE_PATH/site.pl'), generate_entry." \ + swipl --traditional -q -l parse_entry.pl -g "consult('$SITE_PATH/site.pl'), generate_entry." | + # Smarten remaining punctuation (e.g. parts of the template). + smartypants \ > "$NEW_PATH" fi done