squeeze

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

commit e1e164124fcd53bb07d0b1b6268424bcfc572b36
parent 9ae36242606ecb980677782f087df053f3daee2e
Author: St John Karp <stjohn@fuzzjunket.com>
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.

Diffstat:
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