2222--
2323-- @
2424-- This is a paragraph.
25- --
25+ --
2626-- ```{.matlabplot}
2727-- figure()
2828-- plot([1,2,3,4,5], [1,2,3,4,5], '-k')
3434-- @
3535-- ```{.gnuplot format=png caption="Sinusoidal function" source=true}
3636-- sin(x)
37- --
37+ --
3838-- set xlabel "x"
3939-- set ylabel "y"
4040-- ```
6363-- code block will be ignored. This path should be specified with respect to the current working
6464-- directory, and not with respect to the document.
6565--
66- -- All attributes are described in the online documentation, linked on the home page.
67-
66+ -- All attributes are described in the online documentation, linked on the home page.
6867module Text.Pandoc.Filter.Plot
6968 ( -- * Operating on whole Pandoc documents
7069 plotFilter ,
@@ -106,7 +105,7 @@ import Data.Map (singleton)
106105import Data.Text (Text , pack , unpack )
107106import Data.Version (Version )
108107import Paths_pandoc_plot (version )
109- import Text.Pandoc.Definition (Block , Meta (.. ), Format , MetaValue (.. ), Pandoc (.. ))
108+ import Text.Pandoc.Definition (Block , Format , Meta (.. ), MetaValue (.. ), Pandoc (.. ))
110109import Text.Pandoc.Filter.Plot.Internal
111110 ( Configuration (.. ),
112111 FigureSpec ,
@@ -175,19 +174,20 @@ plotFilter conf mfmt (Pandoc meta blocks) = do
175174-- on documents without having all necessary toolkits installed. In this case, error
176175-- messages are printed to stderr, and blocks are left unchanged.
177176--
178- -- __Note that this function is DEPRECATED in favour of @plotFilter@. It will be
177+ -- __Note that this function is DEPRECATED in favour of @plotFilter@. It will be
179178-- removed in the next major update (v2+).__
180179plotTransform ::
181180 -- | Configuration for default values
182181 Configuration ->
183182 -- | Input document
184183 Pandoc ->
185184 IO Pandoc
186- {-# DEPRECATED plotTransform
187- [ "plotTransform has been deprecated in favour of plotFilter, which is aware of conversion format."
188- , "plotTransform will be removed in an upcoming major update."
189- ]
190- #-}
185+ {-# DEPRECATED
186+ plotTransform
187+ [ "plotTransform has been deprecated in favour of plotFilter, which is aware of conversion format.",
188+ "plotTransform will be removed in an upcoming major update."
189+ ]
190+ #-}
191191plotTransform conf = plotFilter conf Nothing
192192
193193-- | The version of the pandoc-plot package.
@@ -197,7 +197,7 @@ pandocPlotVersion :: Version
197197pandocPlotVersion = version
198198
199199-- | Try to process the block with `pandoc-plot`. If a failure happens (or the block)
200- -- was not meant to become a figure, return the block as-is unless running in strict mode.
200+ -- was not meant to become a figure, return the block as-is unless running in strict mode.
201201-- In strict mode, any failure (for example, due to a missing plotting toolkit) will halt execution.
202202--
203203-- New in version 1.2.0: this function will detect nested code blocks, for example in @Div@ blocks.
@@ -208,7 +208,7 @@ make = walkM $ \blk -> either (onError blk) return =<< makeEither blk
208208 onError b e = do
209209 whenStrict $ throwStrictError (pack . show $ e)
210210 return b
211-
211+
212212 whenStrict f = asksConfig strictMode >>= \ s -> when s f
213213
214214-- | Try to process the block with `pandoc-plot`, documenting the error.
@@ -239,4 +239,4 @@ instance Show PandocPlotError where
239239 show (ScriptRuntimeError _ exitcode) = " ERROR (pandoc-plot) The script failed with exit code " <> show exitcode <> " ."
240240 show (ScriptChecksFailedError msg) = " ERROR (pandoc-plot) A script check failed with message: " <> unpack msg <> " ."
241241 show (ToolkitNotInstalledError tk) = " ERROR (pandoc-plot) The " <> show tk <> " toolkit is required but not installed."
242- show (IncompatibleSaveFormatError tk sv) = " ERROR (pandoc-plot) Save format " <> show sv <> " not supported by the " <> show tk <> " toolkit."
242+ show (IncompatibleSaveFormatError tk sv) = " ERROR (pandoc-plot) Save format " <> show sv <> " not supported by the " <> show tk <> " toolkit."
0 commit comments