Safe Haskell | None |
---|---|
Language | Haskell2010 |
Rendering of templates
- type PDFContent = ByteString
- data PDFRenderException
- displayPDFRenderException :: PDFRenderException -> String
- renderBundleOrTemplateFromFile :: FilePath -> Maybe Value -> Sh PDFContent
- renderFromFileBundleToPDF :: FilePath -> Maybe Value -> Sh PDFContent
- renderFromFileToPDF :: FilePath -> Sh PDFContent
- renderBundleToPDF :: Template -> Sh PDFContent
- renderTemplateToPDF :: TemplateFile -> FilePath -> Sh PDFContent
- loadTemplateInMemory :: TemplateFile -> FilePath -> Sh (Either String Template)
- storeTemplateInFiles :: Template -> FilePath -> Sh TemplateFile
- type DepFlags = Set DepFlag
- data DepFlag = NeedBibtex
- renderPdfTemplate :: Maybe Value -> TemplateFile -> FilePath -> FilePath -> Sh ()
- renderTemplate :: Maybe Value -> TemplateFile -> FilePath -> FilePath -> Sh DepFlags
- renderTemplateDep :: Maybe Value -> FilePath -> FilePath -> TemplateName -> TemplateDependencyFile -> Sh DepFlags
- parseBundleOrTemplate :: FilePath -> ByteString -> Sh (Either Template TemplateFile)
- parseBundleOrTemplateFromFile :: FilePath -> Sh (Either Template TemplateFile)
Documentation
type PDFContent = ByteString Source #
Contents of PDF file
data PDFRenderException Source #
Errors that are thrown by rendering functions
TemplateFormatError FilePath ParseException | Failed to parse template YAML |
BundleFormatError FilePath ParseException | Failed to parse template bundle YAML | Failed to parse file in both formats: bundle and template file. |
BundleOrTemplateFormatError FilePath ParseException ParseException | |
InputFileFormatError FilePath String | Failed to parse JSON input |
displayPDFRenderException :: PDFRenderException -> String Source #
Convert PDF rendering exception to user readable format
renderBundleOrTemplateFromFile Source #
:: FilePath | Path to either bundle |
-> Maybe Value | Overwrite of input JSON for bundle |
-> Sh PDFContent |
Helper to render either a bundle or distributed template from file to PDF.
renderFromFileBundleToPDF Source #
:: FilePath | Path to |
-> Maybe Value | Overwrite of input JSON for bundle |
-> Sh PDFContent |
Helper to render from all-in bundle template
:: FilePath | Path to |
-> Sh PDFContent |
Helper to render from template file
:: Template | Input all-in template |
-> Sh PDFContent |
Unpack bundle, render the template, cleanup and return PDF
:: TemplateFile | Input template |
-> FilePath | Base directory |
-> Sh PDFContent | Output PDF file |
Render template and return content of resulted PDF file
loadTemplateInMemory :: TemplateFile -> FilePath -> Sh (Either String Template) Source #
Load all external references of template into memory
storeTemplateInFiles :: Template -> FilePath -> Sh TemplateFile Source #
Extract all external references of template into file system
Low-level
type DepFlags = Set DepFlag Source #
Collected dependency markers (for instance, that we need bibtex compilation)
Dependency marker that is returned from renderTemplateDep
NeedBibtex | We need a bibtex compliation |
:: Maybe Value | Inherited input from parent |
-> TemplateFile | Template to render |
-> FilePath | Base directory |
-> FilePath | Output folder |
-> Sh () |
Low-level render of template from .htex to .pdf that is recursively used for dependencies
:: Maybe Value | Inherited input from parent |
-> TemplateFile | Template to render |
-> FilePath | Base directory |
-> FilePath | Output folder |
-> Sh DepFlags | Flags that affects compilation upper in the deptree |
Low-level render of template from .htex to .tex that is recursively used for dependencies
:: Maybe Value | Inherited input from parent |
-> FilePath | Base directory |
-> FilePath | Output folder |
-> TemplateName | Dependency name |
-> TemplateDependencyFile | Dependency type |
-> Sh DepFlags |
Render template dependency
parseBundleOrTemplate Source #
:: FilePath | Source of data (file or stdin, etc) |
-> ByteString | Contents of either |
-> Sh (Either Template TemplateFile) |
Try to parse either a bundle or template file
parseBundleOrTemplateFromFile Source #
:: FilePath | Path to either |
-> Sh (Either Template TemplateFile) |
Try to parse either a bundle or template file