summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Filter
diff options
context:
space:
mode:
authorLaurentRDC <>2018-10-05 20:26:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-10-05 20:26:00 (GMT)
commit0619d9948775e6bbc8a57c2b9a926054b4c42411 (patch)
tree1f48878d99e56a72423aa039805f8935450852f4 /src/Text/Pandoc/Filter
parentbd69719e1be7f45a7448294bac0664578fd6d380 (diff)
version 1.0.0.11.0.0.1
Diffstat (limited to 'src/Text/Pandoc/Filter')
-rw-r--r--src/Text/Pandoc/Filter/Pyplot.hs14
-rw-r--r--src/Text/Pandoc/Filter/Scripting.hs14
2 files changed, 28 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Filter/Pyplot.hs b/src/Text/Pandoc/Filter/Pyplot.hs
index 56e1b7b..512b7e1 100644
--- a/src/Text/Pandoc/Filter/Pyplot.hs
+++ b/src/Text/Pandoc/Filter/Pyplot.hs
@@ -1,5 +1,18 @@
{-# LANGUAGE MultiWayIf #-}
+{-# LANGUAGE Unsafe #-}
+{-|
+Module : Text.Pandoc.Filter.Pyplot
+Description : Pandoc filter to create Matplotlib figures from code blocks
+Copyright : (c) Laurent P René de Cotret, 2018
+License : MIT
+Maintainer : laurent.decotret@outlook.com
+Stability : stable
+Portability : portable
+This module defines a Pandoc filter @makePlot@ that can be
+used to walk over a Pandoc document and generate figures from
+Python code blocks.
+-}
module Text.Pandoc.Filter.Pyplot (
makePlot
, makePlot'
@@ -15,6 +28,7 @@ import Text.Pandoc.Definition
import Text.Pandoc.Filter.Scripting
+-- | Possible errors returned by the filter
data PandocPyplotError = ScriptError Int -- ^ Running Python script has yielded an error
| InvalidTargetError FilePath -- ^ Invalid figure path
| BlockingCallError -- ^ Python script contains a block call to 'show()'
diff --git a/src/Text/Pandoc/Filter/Scripting.hs b/src/Text/Pandoc/Filter/Scripting.hs
index 90e9e92..b88b039 100644
--- a/src/Text/Pandoc/Filter/Scripting.hs
+++ b/src/Text/Pandoc/Filter/Scripting.hs
@@ -1,3 +1,15 @@
+{-# LANGUAGE Unsafe #-}
+{-|
+Module : Text.Pandoc.Filter.Scripting
+Copyright : (c) Laurent P René de Cotret, 2018
+License : MIT
+Maintainer : laurent.decotret@outlook.com
+Stability : internal
+Portability : portable
+
+This module defines types and functions that help
+with running Python scripts.
+-}
module Text.Pandoc.Filter.Scripting (
runTempPythonScript
@@ -15,8 +27,10 @@ import System.Process.Typed (runProcess, shell)
import Data.Monoid (Any(..))
+-- | String representation of a Python script
type PythonScript = String
+-- | Possible result of running a Python script
data ScriptResult = ScriptSuccess
| ScriptFailure Int