Commits

Moritz Heidkamp  committed dfc8647

Add fancification to lowdown-extra (as suggested by retroj)

  • Participants
  • Parent commits a25dc56

Comments (0)

Files changed (1)

File lowdown-extra.scm

  lowdown-extra-html-conversion-rules*)
 
 (import chicken scheme)
-(use comparse lowdown lowdown-lolevel clojurian-syntax)
+
+(use srfi-1
+     comparse
+     lowdown
+     lowdown-lolevel
+     clojurian-syntax
+     (prefix fancypants fancypants-))
 
 (define inline-note
   (enclosed-by (char-seq "^[")
                     (node 'inline-note))
                (char-seq "]")))
 
+(define fancypants
+  (any-of
+   (map (lambda (mapping)
+          (preceded-by (char-seq (car mapping))
+                       (result (cdr mapping))))
+        fancypants-default-map)))
+
 (define lowdown-extra-html-conversion-rules*
   `((inline-note . ,(lambda (_ contents)
                       `(span (@ (class "note")) . ,contents)))))
 
 (define (enable-lowdown-extra!)
-  (inline-hook (cons inline-note (inline-hook)))
+  (inline-hook (cons* inline-note fancypants (inline-hook)))
   (markdown-html-conversion-rules*
    (append lowdown-extra-html-conversion-rules*
            (markdown-html-conversion-rules*)))