The pandocl Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The pandocl Reference Manual

This is the pandocl Reference Manual, version 0.1, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:22:05 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

Pandocl

A document converter built on CommonDoc.

Usage

Converting

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">

Parsing

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">

Emitting

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">

Formats

Supported

Supported input formats:

Supported output formats:

File extensions

When Pandocl tries to guess which format to use from a pathname type, it uses the following rules:

License

Copyright (c) 2015 Fernando Borretti

Licensed under the MIT License.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 pandocl

Maintainer

Fernando Borretti <eudoxiahp@gmail.com>

Author

Fernando Borretti <eudoxiahp@gmail.com>

Home Page
Source Control

(:git "")

Bug Tracker
License

MIT

Description

A universal document converter.

Long Description

# Pandocl

A document converter built on [CommonDoc][cdoc].

# Usage

## Converting

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.

“‘lisp
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">
“‘

## Parsing

The ‘parse‘ function takes a pathname and optionally an input format (Otherwise
it guesses it from the pathname) and returns a CommonDoc document.

“‘lisp
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">
“‘

## Emitting

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][w-o-f]). The function returns the document.

“‘lisp
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">
“‘

# Formats

## Supported

Supported input formats:

* [‘:vertex‘](https://github.com/CommonDoc/vertex)
* [‘:scriba‘](https://github.com/CommonDoc/scriba)

Supported output formats:

* [‘:html‘](https://github.com/CommonDoc/common-html)

## File extensions

When Pandocl tries to guess which format to use from a pathname type, it uses
the following rules:

* ‘.tex‘: VerTeX
* ‘.scr‘: Scriba
* ‘.html‘: HTML

[cdoc]: https://github.com/CommonDoc/common-doc
[w-o-f]: http://www.lispworks.com/documentation/HyperSpec/Body/m_w_open.htm#with-open-file

# License

Copyright (c) 2015 Fernando Borretti

Licensed under the MIT License.

Version

0.1

Dependencies
Source

pandocl.asd (file)

Component

src (module)


Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Previous: , Up: Modules   [Contents][Index]

3.1 pandocl/src

Parent

pandocl (system)

Location

src/

Component

pandocl.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 pandocl.asd

Location

pandocl.asd

Systems

pandocl (system)


Previous: , Up: Lisp files   [Contents][Index]

4.1.2 pandocl/src/pandocl.lisp

Parent

src (module)

Location

src/pandocl.lisp

Packages

pandocl

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

5.1 pandocl

Source

pandocl.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Functions

Function: convert INPUT-PATHNAME OUTPUT-PATHNAME &key INPUT-FORMAT OUTPUT-FORMAT IF-EXISTS IF-DOES-NOT-EXIST

Convert a file to another format.

Package

pandocl

Source

pandocl.lisp (file)

Function: emit DOCUMENT PATHNAME &key FORMAT IF-EXISTS IF-DOES-NOT-EXIST

Dump a document to a file, optionally specifying an output format.

Package

pandocl

Source

pandocl.lisp (file)

Function: guess-format PATHNAME

Try to guess the CommonDoc format from a pathname, or signal unknown-file-extension.

Package

pandocl

Source

pandocl.lisp (file)

Function: parse PATHNAME &key FORMAT

Parse a document from a file, optionally specifying an input format.

Package

pandocl

Source

pandocl.lisp (file)

Function: parse-string STRING FORMAT

Parse a string, necessarily specifying an input format.

Package

pandocl

Source

pandocl.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

6.1.2 Conditions

Condition: pandocl-error ()

The base class of Pandocl-related errors.

Package

pandocl

Source

pandocl.lisp (file)

Direct superclasses

condition (condition)

Direct subclasses
Condition: unknown-file-extension ()

Signalled when Pandocl tries to guess a file format from a file extension and fails.

Package

pandocl

Source

pandocl.lisp (file)

Direct superclasses

pandocl-error (condition)

Direct methods

extension (method)

Direct slots
Slot: extension

The file extension.

Initargs

:extension

Readers

extension (generic function)

Condition: unsupported-format ()

Signalled when a user-specified format is not known.

Package

pandocl

Source

pandocl.lisp (file)

Direct superclasses

pandocl-error (condition)

Direct methods

format-name (method)

Direct slots
Slot: format-name

The name of the format.

Initargs

:format-name

Readers

format-name (generic function)


Previous: , Up: Definitions   [Contents][Index]

6.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Special variables

Special Variable: +format-class-map+

A plist of format names to classes.

Package

pandocl

Source

pandocl.lisp (file)

Special Variable: +format-extension-map+

A list of file extensions to format names.

Package

pandocl

Source

pandocl.lisp (file)

Special Variable: +supported-input-formats+

A list of supported input formats.

Package

pandocl

Source

pandocl.lisp (file)

Special Variable: +supported-output-formats+

A list of supported output formats.

Package

pandocl

Source

pandocl.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.2 Functions

Function: check-supported-format FORMAT-NAME LIST
Package

pandocl

Source

pandocl.lisp (file)

Function: check-supported-input-format FORMAT-NAME

If the input format is not supported, raise unsupported-format.

Package

pandocl

Source

pandocl.lisp (file)

Function: check-supported-output-format FORMAT-NAME

If the output format is not supported, raise unsupported-format.

Package

pandocl

Source

pandocl.lisp (file)

Function: find-format FORMAT-NAME

Find the class corresponding to a format name.

Package

pandocl

Source

pandocl.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

6.2.3 Generic functions

Generic Function: extension CONDITION
Package

pandocl

Methods
Method: extension (CONDITION unknown-file-extension)
Source

pandocl.lisp (file)

Generic Function: format-name CONDITION
Package

pandocl

Methods
Method: format-name (CONDITION unsupported-format)
Source

pandocl.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   M   P  
Index Entry  Section

F
File, Lisp, pandocl.asd: The pandocl<dot>asd file
File, Lisp, pandocl/src/pandocl.lisp: The pandocl/src/pandocl<dot>lisp file

L
Lisp File, pandocl.asd: The pandocl<dot>asd file
Lisp File, pandocl/src/pandocl.lisp: The pandocl/src/pandocl<dot>lisp file

M
Module, pandocl/src: The pandocl/src module

P
pandocl.asd: The pandocl<dot>asd file
pandocl/src: The pandocl/src module
pandocl/src/pandocl.lisp: The pandocl/src/pandocl<dot>lisp file

Jump to:   F   L   M   P  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   C   E   F   G   M   P  
Index Entry  Section

C
check-supported-format: Internal functions
check-supported-input-format: Internal functions
check-supported-output-format: Internal functions
convert: Exported functions

E
emit: Exported functions
extension: Internal generic functions
extension: Internal generic functions

F
find-format: Internal functions
format-name: Internal generic functions
format-name: Internal generic functions
Function, check-supported-format: Internal functions
Function, check-supported-input-format: Internal functions
Function, check-supported-output-format: Internal functions
Function, convert: Exported functions
Function, emit: Exported functions
Function, find-format: Internal functions
Function, guess-format: Exported functions
Function, parse: Exported functions
Function, parse-string: Exported functions

G
Generic Function, extension: Internal generic functions
Generic Function, format-name: Internal generic functions
guess-format: Exported functions

M
Method, extension: Internal generic functions
Method, format-name: Internal generic functions

P
parse: Exported functions
parse-string: Exported functions

Jump to:   C   E   F   G   M   P  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   +  
E   F   S  
Index Entry  Section

+
+format-class-map+: Internal special variables
+format-extension-map+: Internal special variables
+supported-input-formats+: Internal special variables
+supported-output-formats+: Internal special variables

E
extension: Exported conditions

F
format-name: Exported conditions

S
Slot, extension: Exported conditions
Slot, format-name: Exported conditions
Special Variable, +format-class-map+: Internal special variables
Special Variable, +format-extension-map+: Internal special variables
Special Variable, +supported-input-formats+: Internal special variables
Special Variable, +supported-output-formats+: Internal special variables

Jump to:   +  
E   F   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S   U  
Index Entry  Section

C
Condition, pandocl-error: Exported conditions
Condition, unknown-file-extension: Exported conditions
Condition, unsupported-format: Exported conditions

P
Package, pandocl: The pandocl package
pandocl: The pandocl system
pandocl: The pandocl package
pandocl-error: Exported conditions

S
System, pandocl: The pandocl system

U
unknown-file-extension: Exported conditions
unsupported-format: Exported conditions

Jump to:   C   P   S   U