From 9fce418b46c9f0894f429384ef9e3dabaeffbeb4 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 14 Apr 2015 16:36:17 -0700 Subject: Change file hierarchy and rewrite makefile - File hierarchy is now as follows: - / - appendix/ < appendix source files - backlinks/ < backlink sources & builds - hapax/ < *.hapax source files - scripts/ < scripts, like *.js, *.hs, etc. - templates/ < templates for outputs - text/ < source files - trunk/ < assets, like css, images, heads, etc. - index.html - *.html - Makefile --- scripts/forceascii.hs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/forceascii.hs (limited to 'scripts/forceascii.hs') diff --git a/scripts/forceascii.hs b/scripts/forceascii.hs new file mode 100644 index 0000000..b5f1645 --- /dev/null +++ b/scripts/forceascii.hs @@ -0,0 +1,17 @@ +-- Preprocessor for hapax.lua writer +-- because for some damn reason, UTF-8 confuses things + +import Text.Pandoc.JSON +import Data.Char (isAscii) + +main :: IO () +main = toJSONFilter unFancy + +unFancy :: Inline -> Inline +unFancy (Str s) = Str $ map makeAscii s +unFancy x = x + +makeAscii :: Char -> Char +makeAscii c + | isAscii c = c + | otherwise = ' ' -- cgit 1.4.1-21-gabe81