pdf-slave-1.3.2.0: Tool to generate PDF from haskintex templates and YAML input

Safe HaskellNone
LanguageHaskell2010

Text.PDF.Slave.Render

Contents

Description

Rendering of templates

Synopsis

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

Instances

Show PDFRenderException Source # 
Generic PDFRenderException Source # 
Exception PDFRenderException Source # 
type Rep PDFRenderException Source # 

displayPDFRenderException :: PDFRenderException -> String Source #

Convert PDF rendering exception to user readable format

renderBundleOrTemplateFromFile Source #

Arguments

:: FilePath

Path to either bundle Template or template TemplateFile

-> 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 Template all-in bundle

-> Maybe Value

Overwrite of input JSON for bundle

-> Bool

Nuke temp folder?

-> Sh PDFContent 

Helper to render from all-in bundle template

renderFromFileToPDF Source #

Arguments

:: FilePath

Path to TemplateFile

-> Bool

Nuke temp folder?

-> Sh PDFContent 

Helper to render from template file

renderBundleToPDF Source #

Arguments

:: Template

Input all-in template

-> Bool

Nuke temp folder?

-> Sh PDFContent 

Unpack bundle, render the template, cleanup and return PDF

renderTemplateToPDF Source #

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)

data DepFlag Source #

Dependency marker that is returned from renderTemplateDep

Constructors

NeedBibtex

We need a bibtex compliation

Instances

Eq DepFlag Source # 

Methods

(==) :: DepFlag -> DepFlag -> Bool #

(/=) :: DepFlag -> DepFlag -> Bool #

Ord DepFlag Source # 
Show DepFlag Source # 
Generic DepFlag Source # 

Associated Types

type Rep DepFlag :: * -> * #

Methods

from :: DepFlag -> Rep DepFlag x #

to :: Rep DepFlag x -> DepFlag #

type Rep DepFlag Source # 
type Rep DepFlag = D1 (MetaData "DepFlag" "Text.PDF.Slave.Render" "pdf-slave-1.3.2.0-6vwRgeDRI2ME03QTZgP7Mc" False) (C1 (MetaCons "NeedBibtex" PrefixI False) U1)

renderPdfTemplate Source #

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

renderTemplate Source #

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

renderTemplateDep Source #

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 Template or TemplateFile

-> Sh (Either Template TemplateFile) 

Try to parse either a bundle or template file

parseBundleOrTemplateFromFile Source #

Arguments

:: FilePath

Path to either Template or TemplateFile

-> Sh (Either Template TemplateFile) 

Try to parse either a bundle or template file