Add Gauche wrapper
This commit is contained in:
parent
ec5cfa689b
commit
0279505d2c
|
@ -0,0 +1,7 @@
|
||||||
|
(define (run-read-write args input-port read-output)
|
||||||
|
(call-with-process-io
|
||||||
|
args
|
||||||
|
(lambda (from-sub to-sub)
|
||||||
|
(copy-port input-port to-sub)
|
||||||
|
(close-output-port to-sub)
|
||||||
|
(read-output from-sub))))
|
|
@ -0,0 +1,20 @@
|
||||||
|
(define-library (pandoc)
|
||||||
|
(export pandoc-command-line
|
||||||
|
pandoc-port->json
|
||||||
|
pandoc-port->sxml
|
||||||
|
pandoc-file->json
|
||||||
|
pandoc-file->sxml)
|
||||||
|
(import (scheme base)
|
||||||
|
(scheme file)
|
||||||
|
(scheme write))
|
||||||
|
(cond-expand
|
||||||
|
(gauche (import (only (srfi 180) json-read)
|
||||||
|
(only (gauche base) copy-port)
|
||||||
|
(only (gauche process) call-with-process-io))))
|
||||||
|
(begin
|
||||||
|
(define pandoc-command-line (make-parameter (list "pandoc")))
|
||||||
|
(define (call-with-binary-input-file filename proc)
|
||||||
|
(call-with-port (open-binary-input-file filename) proc)))
|
||||||
|
(cond-expand
|
||||||
|
(gauche (include "pandoc.gauche.scm")))
|
||||||
|
(include "pandoc.r5rs.scm"))
|
|
@ -0,0 +1,12 @@
|
||||||
|
(import (scheme base) (scheme write))
|
||||||
|
(import (rename (only (gauche base) pprint) (pprint pretty-print))
|
||||||
|
(rename (only (sxml serializer) srl:sxml->html) (srl:sxml->html sxml->html))
|
||||||
|
(pandoc))
|
||||||
|
|
||||||
|
(display (sxml->html (pandoc-file->sxml 'gfm "test/CharEq.md")))
|
||||||
|
(newline)
|
||||||
|
(newline)
|
||||||
|
(display (sxml->html (pandoc-file->sxml 'gfm "test/VoidValue.md")))
|
||||||
|
(newline)
|
||||||
|
(newline)
|
||||||
|
(pretty-print (pandoc-file->json 'gfm "test/VoidValue.md"))
|
Loading…
Reference in New Issue