Using Pandoc
PureBuilder Simply with Pandoc
PureBuilder Simply uses Pandoc by default, and Pandoc give you to use the very powerful Markdown syntax and template engine.
Although you can use advanced features, installing Pandoc can
be a difficult element in some cases. For this reason,
pbsimply-init
uses a Ruby library (kramdown).
To configure it with Pandoc, a different procedure is required.
Install pandoc
In a Linux environment, you only need to install the package if it is available as a package. For example, in Arch linux, do the following:
$ sudo pacman -S pandoc
It can be used with OpenSUSE in the same way, just by installing the package. OpenSUSE Leap is also useful when using WSL on Windows, since it is available as an image in the Windows Store.
$ sudo zypper in pandoc
Pandoc is called by default with the command
pandoc
. It can be overridden by setting
pandoc_command
in .pbsimply.yaml
.
If you want to use it on Windows, you can install Pandoc on a Linux image on WSL, but in terms of performance, using native Windows Pandoc is superior. You can run Windows executables both from the WSL and from the MSYS2 environment used by Ruby for Windows binaries.
After installing Pandoc on Windows, there are two options.
One is to make the Windows binary be recognized by the
environment as the command pandoc
. For example, as
/usr/local/bin/pandoc
, you can write
#!/bin/bash
exec "/mnt/c/Program Files/Pandoc/pandoc.exe"
The other is to set it up in .pbsimply.yaml
.
pandoc_command: "/mnt/c/Program Files/Pandoc/pandoc.exe"
Create project
Use pbsimply-init
with -t
option
creates Pandoc themed project. For exmaple, If you want to use
Paper theme, do
pbsimply-init -t pandoc/paper foo
creates Source
and Build
directory on
foo
. foo/Source/.pbsimply.yaml
includes
settings for using Pandoc.
You can list avilable themes with
pbsimply-init -l
. Please use theme begin with
pandoc/
.
Template
template.html
is a Pandoc template file. See Pandoc User’s Guide#Templates for
specifications.
Themes that require editing template.html
also
include template.html
.
If you want to set up a template from scratch, you can get a default template by running the following command:
pandoc -D html5
Learn More
The basic usage is the same as in Get started.
If you want to understand and use it more deeply, please read Learn more.