| License | BSD-3-Clause |
|---|---|
| Maintainer | Renato Garcia |
| Safe Haskell | None |
| Language | Haskell2010 |
Hakyll.Web.Pandoc.Diagrams
Description
Synopsis
- drawDiagrams :: Pandoc -> Compiler Pandoc
- drawDiagramsWith :: Options -> Pandoc -> Compiler Pandoc
- data Options = Options {
- globalModules :: [(String, Maybe String)]
- localModules :: [(String, Maybe String)]
- searchPaths :: [FilePath]
- languageExtensions :: [String]
- defaultOptions :: Options
- readOptionsFromMetadata :: Compiler Options
- readOptionsFromMetadataWith :: Options -> Compiler Options
Documentation
drawDiagrams :: Pandoc -> Compiler Pandoc #
Call drawDiagramsWith with the defaultOptions.
drawDiagramsWith :: Options -> Pandoc -> Compiler Pandoc #
Render the code inside all CodeBlock with a .diagram class
to either a RawBlock or an Image
(depending on if we have received an attribute with a path to an external file), where
these two can or cannot be within a parent Figure (depending on
if we have received an attribute with a figure caption).
The hint library is used to
interpret the Haskell code, and therefore all of its
limitations will
apply here as well. In particular, if there isn't a .ghc.environment.<something>
package environment
file
(as generated by cabal
--write-ghc-environment-files=always
option), setting either HAKYLL_DIAGRAMS_PACKAGE_ENV (a single path) or
HAKYLL_DIAGRAMS_PACKAGE_DB (N comma-separated paths) environment variables may be
required. If these environment variables are defined, their values will be used to set the
GHC
-package-env
and
-package-db
options respectively.
Configure the interpreter environment used when rendering the diagrams.
This is controlled via 'type Options'.
Constructors
| Options | |
Fields
| |
The default value will import Prelude, Diagrams.Prelude, and Diagrams.Backend.SVG global modules. All other fields will be emtpty.
readOptionsFromMetadata :: Compiler Options #
Call readOptionsFromMetadataWith with defaultOptions as the argument
Arguments
| :: Options | The base |
| -> Compiler Options | The resulting modified |
Read the Options values from
metadata block.
--- dg.localModules: Utils, Commons as Cm dg.searchPaths: lib, ..., posts dg.languageExtensions: "" ---
Each field must be prefixed with a dg. string and must be formatted as a list where each
element is separated by a comma (,).
Any occurrence of an ellipsis (...) will be replaced by the current value of that field
as in the Options first argument. So to append one element at the end of a list, we can
do: "..., element".
When setting either globalModules or localModules, a value like "Utils" will
translate to ("Utils", Nothing), an unqualified import. A value like "Commons as Cm"
will translate to ("Commons", Just "Cm"), a qualified import.
Any field not present will retain the same value as in the base Options. An empty string
"" will set the field to an empty list.