Package Exports
- documark
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (documark) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Documark
PDF generator for scripted documents.
A library that:
- Compiles scripted document files (Jade, Markdown, and assets) into a PDF;
- Is used as a command-line interface (
npm install documark -g,documark compile); - Can watch for files changes (
documark compile --watch) to recompile the document.
Why?
My personally hatret towards WYSIWYG word processors sparked me to write this tool. LaTeX felt like a waste of time, so instead I figured: why not use Markdown? I like Documark because it:
- Separates content and styling
- Uses mature webtechnologies like Markdown, HTML, JS, and CSS for writing/styling the document
- Enforces a consistent document style (no dragging around table columns and floating images)
- Allows version control with Git or SVN
- Simplifies collaboration (by splitting up the document in separate files)
- Allows you to use your favorite text editor - like Vim ❤
- Makes automating things (through plugins) real easy!
Example
Go to the Documark example repository for a generated PDF and its sourcecode.
Dependencies
- Currently manually installing WkHTMLToPDF is still required.
Build process
These are the steps for compiling the PDF document:
- Input files (Jade, Markdown, and assets)
- Generate HTML
- Convert to DOM tree (with CheerioJS)
- Process plugins (which can alter the DOM and PDF configuration)
- Emit
pre-compileevent - Generate PDF
- Emit
post-compileevent
Configuration
Document configuration can be done in two ways:
- In the document's front matter;
- In a separate
config.jsonfile.
If there is front matter in the document, the configuration file will be ignored.
WkHTMLToPDF
Configure WkHTMLToPDF with the pdf object in the documents front matter. For example:
---
title: Document
pdf:
userStyleSheet: path/to/main.css
---See this page for a full list of configuration options.