-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A Pandoc filter for including figures generated from Matplotlib
--
-- A pandoc filter for including figures generated from Matplotlib. Keep
-- the document and Python code in the same location. Output from
-- Matplotlib is captured and included as a figure.
@package pandoc-pyplot
@version 1.0.0.0
module Text.Pandoc.Filter.Scripting
-- | Take a python script in string form, write it in a temporary
-- directory, then execute it.
runTempPythonScript :: PythonScript -> IO ScriptResult
-- | Modify a Python plotting script to save the figure to a filename.
addPlotCapture :: FilePath -> PythonScript -> IO PythonScript
-- | Detect the presence of a blocking show call, for example "plt.show()"
hasBlockingShowCall :: PythonScript -> Bool
type PythonScript = String
data ScriptResult
ScriptSuccess :: ScriptResult
ScriptFailure :: Int -> ScriptResult
module Text.Pandoc.Filter.Pyplot
-- | 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 Block
-- | 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
makePlot' :: Block -> IO (Either PandocPyplotError Block)
data PandocPyplotError
-- | Running Python script has yielded an error
ScriptError :: Int -> PandocPyplotError
-- | Invalid figure path
InvalidTargetError :: FilePath -> PandocPyplotError
-- | Python script contains a block call to 'show()'
BlockingCallError :: PandocPyplotError
-- | Translate filter error to an error message
showError :: PandocPyplotError -> String