Pandoc::Filter::ImagesFromCode - transform code blocks into images
This Pandoc::Filter transforms CodeBlock elements into Image elements. Content of transformed code section and resulting image files are written to files.
Attribute title is mapped to the image title and attribute caption to an image caption, if available.
title
caption
File extension of input files extracted from code blocks. Defaults to code.
code
File extension of created image files. Can be a fixed string or a code reference that gets the document output format (for instance latex or html) as argument to produce different image formats depending on output format.
html
Code reference that maps the CodeBlock element to a filename (without directory and extension). By default the element's id is used if it contains characters no other than a-zA-Z0-9_-. Otherwise the name is the MD5 hash of the element's content.
id
a-zA-Z0-9_-
Directory where to place input and output files, relative to the current directory. This directory (default .) is prepended to all image references in the target document.
.
Command to transform input files to output files. Variable references $...$ can be used to refer to current values of from, to, name, dir, infile and outfile. Example:
$...$
from
to
name
dir
infile
outfile
run => ['ditaa', '-o', '$infile$', '$outfile$'],
Capture output of command and write it to outfile. Disabled by default.
Apply transformation also if input and output file already exists unchanged. Disabled by default.
To install Pandoc::Elements, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pandoc::Elements
CPAN shell
perl -MCPAN -e shell install Pandoc::Elements
For more information on module installation, please visit the detailed CPAN module installation guide.