| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Text.PDF.Slave.Render
Contents
Description
Rendering of templates
- type PDFContent = ByteString
- data PDFRenderException
- displayPDFRenderException :: PDFRenderException -> String
- renderBundleOrTemplateFromFile :: FilePath -> Maybe Value -> Bool -> Sh PDFContent
- renderFromFileBundleToPDF :: FilePath -> Maybe Value -> Bool -> Sh PDFContent
- renderFromFileToPDF :: FilePath -> Bool -> Sh PDFContent
- renderBundleToPDF :: Template -> Bool -> Sh PDFContent
- renderTemplateToPDF :: TemplateFile -> FilePath -> Bool -> 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
Constructors
| 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 #
Arguments
| :: FilePath | Path to either bundle |
| -> Maybe Value | Overwrite of input JSON for bundle |
| -> Bool | Nuke temp folder? |
| -> Sh PDFContent |
Helper to render either a bundle or distributed template from file to PDF.
renderFromFileBundleToPDF Source #
Arguments
| :: FilePath | Path to |
| -> Maybe Value | Overwrite of input JSON for bundle |
| -> Bool | Nuke temp folder? |
| -> Sh PDFContent |
Helper to render from all-in bundle template
Arguments
| :: FilePath | Path to |
| -> Bool | Nuke temp folder? |
| -> Sh PDFContent |
Helper to render from template file
Arguments
| :: Template | Input all-in template |
| -> Bool | Nuke temp folder? |
| -> Sh PDFContent |
Unpack bundle, render the template, cleanup and return PDF
Arguments
| :: TemplateFile | Input template |
| -> FilePath | Base directory |
| -> Bool | Nuke temp folder? |
| -> 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
Constructors
| NeedBibtex | We need a bibtex compliation |
Arguments
| :: 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
Arguments
| :: 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
Arguments
| :: 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 #
Arguments
| :: 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 #
Arguments
| :: FilePath | Path to either |
| -> Sh (Either Template TemplateFile) |
Try to parse either a bundle or template file