{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecordWildCards #-}
module Text.Pandoc.Filter.Plot.Renderers.Plotsjl (
plotsjlSupportedSaveFormats
, plotsjlCommand
, plotsjlCapture
, plotsjlAvailable
) where
import Text.Pandoc.Filter.Plot.Renderers.Prelude
plotsjlSupportedSaveFormats :: [SaveFormat]
plotsjlSupportedSaveFormats = [PNG, SVG, PDF]
plotsjlCommand :: OutputSpec -> PlotM Text
plotsjlCommand OutputSpec{..} = do
exe <- executable Plotsjl
return [st|#{exe} "#{oScriptPath}"|]
plotsjlAvailable :: PlotM Bool
plotsjlAvailable = do
exe <- executable Plotsjl
commandSuccess [st|#{exe} -e "using Plots"|]
plotsjlCapture :: FigureSpec -> FilePath -> Script
plotsjlCapture _ fname = [st|
savefig(raw"#{fname}")
|]