From 423ac382f9e73bf1ca7fc6b400f98db087cd7d22 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 5 Jun 2024 09:21:25 -0500 Subject: Write executable This involved moving `src' to `lib' and making `bin'. `bin' holds the program, which only imports `jimmy.main' from lib. --- src/html.scm | 61 ------------------------------------------------------------ 1 file changed, 61 deletions(-) delete mode 100644 src/html.scm (limited to 'src/html.scm') diff --git a/src/html.scm b/src/html.scm deleted file mode 100644 index 07cd921..0000000 --- a/src/html.scm +++ /dev/null @@ -1,61 +0,0 @@ -(declare (module (jimmy html))) - -(import scheme (chicken base) - (chicken irregex) - (jimmy emit) - (jimmy util)) - -(define (escape-entities s) - (irregex-replace/all "[&<>]" s - (lambda (m) - (let ((c (irregex-match-substring m))) - (cond - ((equal? c "&") "&") - ((equal? c "<") "<") - ((equal? c ">") ">")))))) - -(define (add-inline-markup s) - (define (char->tag ch tag) - (lambda (s) - (irregex-replace/all `(: ,ch ($ (* (~ ,ch))) ,ch) s - "<" tag ">" 1 ""))) - - ((o (char->tag "*" "b") - (char->tag "_" "i") - (char->tag "`" "code")) s)) - -(formats - '((para (line . "~a~%") - (stanza . "

~% ~a

~%")) - (verb (line . "~a~%") - (stanza . "
~a
~%")) - (link (line . "
  • ~a
  • ~%") - (stanza . "~%") - (inline . "~a~%")) - (list (line . "
  • ~a
  • ~%") - (stanza . "~%")) - (quot (line . "~a~%") - (stanza . "
    ~% ~a
    ~%")) - (hdr1 (line . "~a") - (stanza . "

    ~a

    ~%")) - (hdr2 (line . "~a") - (stanza . "

    ~a

    ~%")) - (hdr3 (line . "~a") - (stanza . "

    ~a

    ~%")))) - -(filters - `((verb (line . ,identity) - (stanza . ,join-lines)) - (link (line . ,(lambda (ln) - (cons (car ln) - ((o list - add-inline-markup - escape-entities - string-join) - (cdr ln)))))) - (default - (line . ,(o list - add-inline-markup - escape-entities - string-join)) - (stanza . ,string-join)))) -- cgit 1.4.1-21-gabe81