Safe Haskell | None |
---|---|
Language | Haskell2010 |
Reexports
- type TemplateName = Text
- type TemplateInput = Value
- type TemplateBody = Text
- type TemplateBibtex = Text
- type DependencyBody = ByteString
- type BibTexBody = Text
- data TemplateDependency
- data Template = Template {}
- data TemplateDependencyFile
- data TemplateFile = TemplateFile {}
- loadTemplateInMemory :: TemplateFile -> Sh (Either String Template)
- storeTemplateInFiles :: Template -> FilePath -> Sh TemplateFile
- type PDFContent = ByteString
- renderTemplateToPDF :: TemplateFile -> FilePath -> Sh PDFContent
Template definition
type TemplateName = Text Source #
Template unique name
type TemplateInput = Value Source #
A template takes simple YAML document as input
type TemplateBody = Text Source #
Template body is text with .htex content
type TemplateBibtex = Text Source #
Template can define additional bibtex database
type DependencyBody = ByteString Source #
Dependency can be a binary file
type BibTexBody = Text Source #
Content of bibtex file
data TemplateDependency Source #
Template has different types of dependencies, each type of the dependecy has own affect on rendering pipe.
BibtexDep BibTexBody | Bibtex file for references to other documents. Need call to bibtex |
TemplateDep Template | HTex file that need to be compiled to .tex file |
TemplatePdfDep Template | HTex file that need to be compiled to .pdf file |
OtherDep DependencyBody | Any other file that doesn't need a compilation (listings, images, etc) |
Description of document template
Template | |
|
data TemplateDependencyFile Source #
Same as TemplateDependency
but keeps contents in separate files
BibtexDepFile | Bibtex file for references to other documents. Need call to bibtex. Name of dependency is a filename with contents. |
TemplateDepFile TemplateFile | HTex file that need to be compiled to .tex file Name of dependency defines a subfolder for the template. |
TemplatePdfDepFile TemplateFile | HTex file that need to be compiled to .pdf file Name of dependency deinfes a subfolder for the template. |
OtherDepFile | Any other file that doesn't need a compilation (listings, images, etc) Name of dependency is a filename with contents. |
data TemplateFile Source #
Same as Template
, but holds info about template content and dependencies
in other files.
TemplateFile | |
|
Bundle helpers
loadTemplateInMemory :: TemplateFile -> 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
Template rendering to PDF
type PDFContent = ByteString Source #
Contents of PDF file
:: TemplateFile | Input template |
-> FilePath | Base directory |
-> Sh PDFContent | Output PDF file |
Render template and return content of resulted PDF file