https://github.com/CommonDoc/pandocl.git
git clone 'https://github.com/CommonDoc/pandocl.git'
(ql:quickload :pandocl)
A document converter built on CommonDoc.
The convert
function takes two required arguments: The pathname of the input
and the pathname of the output. Two optional keyword arguments, :input-format
and :output-format
, can be used to specify the format when the pathname is not
enough to guess. It returns the parsed document.
CL-USER> (pandocl:convert #p"input.tex" #p"output.html")
#<COMMON-DOC:DOCUMENT "My Document">
CL-USER> (pandocl:emit #p"input.tex" #p"output.html"
:input-format :vertex
:output-format :html)
#<COMMON-DOC:DOCUMENT "My Document">
The parse
function takes a pathname and optionally an input format (Otherwise
it guesses it from the pathname) and returns a CommonDoc document.
CL-USER> (pandocl:parse #p"path/to/doc.tex")
#<COMMON-DOC:DOCUMENT "My Document">
CL-USER> (pandocl:parse #p"path/to/doc.tex" :format :vertex)
#<COMMON-DOC:DOCUMENT "My Document">
The emit
function takes a document, a pathname to write it to, and optionally
a format for the output (Otherwise it tries to guess from the pathname). It
takes an extra two keyword arguments, :if-exists
and :if-does-not-exist
,
which control behaviour when opening the file (See with-open-file). The
function returns the document.
CL-USER> (pandocl:emit doc #p"path/to/output.html")
#<COMMON-DOC:DOCUMENT "My Document">
CL-USER> (pandocl:emit doc #p"path/to/output.html" :format :html)
#<COMMON-DOC:DOCUMENT "My Document">
Supported input formats:
Supported output formats:
When Pandocl tries to guess which format to use from a pathname type, it uses the following rules:
.tex
: VerTeX.scr
: Scriba.html
: HTMLCopyright (c) 2015 Fernando Borretti
Licensed under the MIT License.