Copyright | (c) Laurent P René de Cotret 2018 |
---|---|
License | MIT |
Maintainer | laurent.decotret@outlook.com |
Stability | stable |
Portability | portable |
Safe Haskell | Unsafe |
Language | Haskell2010 |
This module defines a Pandoc filter makePlot
that can be
used to walk over a Pandoc document and generate figures from
Python code blocks.
Synopsis
- makePlot :: Block -> IO Block
- makePlot' :: Block -> IO (Either PandocPyplotError Block)
- data PandocPyplotError
- showError :: PandocPyplotError -> String
Documentation
makePlot :: Block -> IO Block Source #
Highest-level function that can be walked over a Pandoc tree.
All code blocks that have the plot_target
parameter will be considered
figures.
makePlot' :: Block -> IO (Either PandocPyplotError Block) Source #
Main routine to include Matplotlib plots.
Code blocks containing the attributes plot_target
are considered
Python plotting scripts. All other possible blocks are ignored.
The source code is also saved in another file, which can be access by
clicking the image
data PandocPyplotError Source #
Possible errors returned by the filter
ScriptError Int | Running Python script has yielded an error |
InvalidTargetError FilePath | Invalid figure path |
BlockingCallError | Python script contains a block call to 'show()' |
showError :: PandocPyplotError -> String Source #
Translate filter error to an error message