About

nanoc-weasyprint.rb is a nanoc filter that integrates weasyprint into nanoc. The filter can create PDF documents from markdown and other markup languages during the nanoc build process.

Examples

Defaults

The following example uses the default command-line options:

# Rules
require "nanoc-weasyprint"
compile "/example.md" do
  layout("/default.*")
  filter(:kramdown)
  write("/example.html")
  filter(:weasyprint)
  write("/example.pdf")
end

Options

The following example forwards command-line options to weasyprint:

# Rules
require "nanoc-weasyprint"
compile "/example.md" do
  layout("/default.*")
  filter(:kramdown)
  write("/example.html")
  filter(:weasyprint, argv: ["--encoding", "UTF-8"])
  write("/example.pdf")
end

Install

Rubygems.org

nanoc-weasyprint.rb can be installed via rubygems.org.

gem install nanoc-weasyprint.rb

Sources

License

BSD Zero Clause.
See LICENSE.