Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- convertFormulaSvgInline :: EnvironmentOptions -> PandocFormulaOptions -> Inline -> IO Inline
- convertFormulaSvgBlock :: EnvironmentOptions -> PandocFormulaOptions -> Block -> IO Block
- convertFormulaSvgPandoc :: EnvironmentOptions -> PandocFormulaOptions -> Pandoc -> IO Pandoc
- convertFormulaFilesInline :: EnvironmentOptions -> NameSupply -> FilePath -> PandocFormulaOptions -> Inline -> IO Inline
- convertFormulaFilesBlock :: EnvironmentOptions -> NameSupply -> FilePath -> PandocFormulaOptions -> Block -> IO Block
- convertFormulaFilesPandoc :: EnvironmentOptions -> NameSupply -> FilePath -> PandocFormulaOptions -> Pandoc -> IO Pandoc
- type NameSupply = IORef Int
- newNameSupply :: IO NameSupply
- data PandocFormulaOptions = PandocFormulaOptions {}
- type ShrinkSize = Int
- defaultPandocFormulaOptions :: PandocFormulaOptions
- hideError :: RenderError -> Inline
- displayError :: RenderError -> Inline
- convertFormulaSvgInlineWith :: (FormulaOptions -> Formula -> IO (Either RenderError SVG)) -> PandocFormulaOptions -> Inline -> IO Inline
- convertFormulaSvgBlockWith :: (FormulaOptions -> Formula -> IO (Either RenderError SVG)) -> PandocFormulaOptions -> Block -> IO Block
- convertFormulaSvgPandocWith :: (FormulaOptions -> Formula -> IO (Either RenderError SVG)) -> PandocFormulaOptions -> Pandoc -> IO Pandoc
- convertFormulaFilesInlineWith :: (FormulaOptions -> Formula -> IO (Either RenderError SVG)) -> NameSupply -> FilePath -> PandocFormulaOptions -> Inline -> IO Inline
- convertFormulaFilesBlockWith :: (FormulaOptions -> Formula -> IO (Either RenderError SVG)) -> NameSupply -> FilePath -> PandocFormulaOptions -> Block -> IO Block
- convertFormulaFilesPandocWith :: (FormulaOptions -> Formula -> IO (Either RenderError SVG)) -> NameSupply -> FilePath -> PandocFormulaOptions -> Pandoc -> IO Pandoc
SVG
convertFormulaSvgInline Source #
:: EnvironmentOptions | System environment settings |
-> PandocFormulaOptions | Formula display settings |
-> Inline | |
-> IO Inline |
Convert a formula in a pandoc document to an image, embedding the image into the HTML using Data URIs.
convertFormulaSvgBlock Source #
:: EnvironmentOptions | System environment settings |
-> PandocFormulaOptions | Formula display settings |
-> Block | |
-> IO Block |
Convert all formulae in a pandoc block to images, embedding the images into the HTML using Data URIs.
convertFormulaSvgPandoc Source #
:: EnvironmentOptions | System environment settings |
-> PandocFormulaOptions | Formula display settings |
-> Pandoc | |
-> IO Pandoc |
Convert all formulae in a pandoc document to images, embedding the images into the HTML using Data URIs.
Separate Files
convertFormulaFilesInline Source #
:: EnvironmentOptions | System environment settings |
-> NameSupply | Unique file name supply. Reuse this for every invocation that shares the same image directory. |
-> FilePath | Name of image directory where images will be stored |
-> PandocFormulaOptions | Formula display settings |
-> Inline | |
-> IO Inline |
Convert a formula in a pandoc document to an image, storing the images in a separate directory.
convertFormulaFilesBlock Source #
:: EnvironmentOptions | System environment settings |
-> NameSupply | Unique file name supply. Reuse this for every invocation that shares the same image directory. |
-> FilePath | Name of image directory where images will be stored |
-> PandocFormulaOptions | Formula display settings |
-> Block | |
-> IO Block |
Convert every formula in a pandoc block to an image, storing the images in a separate directory.
convertFormulaFilesPandoc Source #
:: EnvironmentOptions | System environment settings |
-> NameSupply | Unique file name supply. Reuse this for every invocation that shares the same image directory. |
-> FilePath | Name of image directory where images will be stored |
-> PandocFormulaOptions | Formula display settings |
-> Pandoc | |
-> IO Pandoc |
Convert every formula in a pandoc document to an image, storing the images in a separate directory.
Name Supplies
type NameSupply = IORef Int Source #
If we use files for the images, we need some way of naming the image files we produce
A NameSupply provides us with a source of unique names via an ever-increasing integer.
It's important that any invocation of convertFormulaFiles
or convertFormulaFiles
that shares the same image storage directory will also use the same name supply, or they
will overwrite each others images.
TODO: remove
newNameSupply :: IO NameSupply Source #
Create a new name supply.
Options
data PandocFormulaOptions Source #
All options pertaining to the actual display of formulae.
PandocFormulaOptions | |
|
type ShrinkSize = Int Source #
Denominator for various dimensions. For high DPI displays, it can be useful to use values of 2 or 4, so that the dimensions of the image are a fraction of the actual image size, and the image appears more crisp. Otherwise, a value of 1 will always produce sensible, if somewhat pixelated results.
defaultPandocFormulaOptions :: PandocFormulaOptions Source #
A set of sensible defaults for formula options.
Error display functions
displayError :: RenderError -> Inline Source #
Render errors nicely, in order to show any problems clearly, with all information intact.
Generalised versions
SVG
convertFormulaSvgInlineWith Source #
:: (FormulaOptions -> Formula -> IO (Either RenderError SVG)) | Function that renders a formula, such as |
-> PandocFormulaOptions | Formula display settings |
-> Inline | |
-> IO Inline |
A generalisation of convertFormulaSvgInline
which allows the actual image rendering
function to be customised, so that (e.g) caching can be added or other image processing.
convertFormulaSvgBlockWith Source #
:: (FormulaOptions -> Formula -> IO (Either RenderError SVG)) | Function that renders a formula, such as |
-> PandocFormulaOptions | Formula display settings |
-> Block | |
-> IO Block |
A generalisation of convertFormulaSvgBlock
which allows the actual image rendering
function to be customised, so that (e.g) caching can be added or other image processing.
convertFormulaSvgPandocWith Source #
:: (FormulaOptions -> Formula -> IO (Either RenderError SVG)) | Function that renders a formula, such as |
-> PandocFormulaOptions | Formula display settings |
-> Pandoc | |
-> IO Pandoc |
A generalisation of convertFormulaSvgPandoc
which allows the actual image rendering
function to be customised, so that (e.g) caching can be added or other image processing.
Files
convertFormulaFilesInlineWith Source #
:: (FormulaOptions -> Formula -> IO (Either RenderError SVG)) | Function that renders a formula, such as |
-> NameSupply | Unique file name supply. Reuse this for every invocation that shares the same image directory. |
-> FilePath | Name of image directory where images will be stored |
-> PandocFormulaOptions | Formula display settings |
-> Inline | |
-> IO Inline |
A generalisation of convertFormulaFilesInline
which allows the actual image rendering
function to be customised, so that (e.g) caching can be added or other image processing.
convertFormulaFilesBlockWith Source #
:: (FormulaOptions -> Formula -> IO (Either RenderError SVG)) | Function that renders a formula, such as |
-> NameSupply | Unique file name supply. Reuse this for every invocation that shares the same image directory. |
-> FilePath | Name of image directory where images will be stored |
-> PandocFormulaOptions | Formula display settings |
-> Block | |
-> IO Block |
A generalisation of convertFormulaFilesBlock
which allows the actual image rendering
function to be customised, so that (e.g) caching can be added or other image processing.
convertFormulaFilesPandocWith Source #
:: (FormulaOptions -> Formula -> IO (Either RenderError SVG)) | Function that renders a formula, such as |
-> NameSupply | Unique file name supply. Reuse this for every invocation that shares the same image directory. |
-> FilePath | Name of image directory where images will be stored |
-> PandocFormulaOptions | Formula display settings |
-> Pandoc | |
-> IO Pandoc |
A generalisation of convertFormulaFilesPandoc
which allows the actual image rendering
function to be customised, so that (e.g) caching can be added or other image processing.