A python static site generator using information stored in yaml files. It is designed to process: html, markdown, and jupyter notebook files. It can be used to generate an entire site or perform markdown to html/LaTeX/Beamer conversion. Check here for more information. My website is generated using this utility. Most of my course websites are also generated using this tool.
- Webify >= 3.0 uses Python 3 (Dec 9, 2019)
Webify requires pandoc (version > 1.19) and LaTeX (for pdf generation). Follow the OS specific instructions for installing pandoc and LaTeX. Below I provide instructions for OSX.
Install Homebrew first. Check https://docs.brew.sh/Installation.
Although, Mac comes with Python3, I prefer to install it within homebrew
$ brew install python3
Next, install MacTeX available at https://www.tug.org/mactex/mactex-download.html
Install pandoc using brew
$ brew install pandoc
Now clone webify in your home folder
$ git clone git@github.com:faisalqureshi/webify.git
Create a Python3 environment that you will use for webify. Before doing the following I confirm that python3
points to brew installation.
$ python3 -m venv ~/venv/webify
$ source activate ~/venv/webify/bin/activate
$ pip3 install -r requirements2.txt
Add the following to environment. E.g., I am using zsh, so I added the following to .zshrc
export WEBIFY_PYTHON=/Users/faisal/venv/webify/bin/python
export WEBIFY_DIR=/Users/faisal/webify/webify
export PANDOC_TEMPLATES=/Users/faisal/Dropbox/Templates/pandoc
export PATH=$WEBIFY_DIR:$PATH
You may have to restart the terminal to ensure the environment variables are captured. You can now test the installation as follows:
$ mdfile
usage: mdfile2.py [-h] [-o OUTPUT] [-f FORMAT] [-i] [--standalone-html] [--do-not-create-output-file] [--version] [-v] [-d] [-l] [--debug-buffer] [--debug-file] [--debug-render] [--debug-timestamps] [--debug-rc]
[--debug-pandoc] [--render-file RENDER_FILE] [--template-file TEMPLATE_FILE] [--include-in-header [INCLUDE_IN_HEADER ...]] [--bibliography [BIBLIOGRAPHY ...]] [--css [CSS ...]] [--csl CSL]
[--highlight-style HIGHLIGHT_STYLE] [--yaml [YAML ...]] [--do-not-preprocess-frontmatter] [--do-not-preprocess-buffer] [--slide-level SLIDE_LEVEL] [--pdf-engine PDF_ENGINE] [--renderer RENDERER]
[--pandoc-var PANDOC_VAR] [--pandoc-meta PANDOC_META]
mdfile
mdfile2.py: error: the following arguments are required: mdfile
and
$ webify
usage: webify2.py [-h] [-i] [--force-copy] [--version] [-v] [-d] [-l] [--debug-rc] [--debug-dirlist] [--debug-db] [--debug-db-ignore] [--debug-yaml] [--debug-render] [--debug-md] [--debug-html]
[--debug-availability] [--debug-ignore] [--debug-live] [--debug-next-run] [--debug-nb] [--debug-nb-settings] [--show-availability] [--show-not-compiled] [--show-not-copied] [--show-compiled]
[--show-ignored] [--live] [--upload-script UPLOAD_SCRIPT] [--live-url-prefix LIVE_URL_PREFIX] [--renderer RENDERER] [--pandoc-var PANDOC_VAR] [--pandoc-meta PANDOC_META]
srcdir destdir
webify2.py: error: the following arguments are required: srcdir, destdir
The installation on Linux is similar, except that instead of brew we will use apt-get to install the relevant packages. The recipe is as follows:
- Install python3
- Install TeX
- Install pandoc (https://pandoc.org/installing.html)
Now follow instructions in "Installing webify and configuring commandline usage" above.
You can install webify on window using the WSL shell running, say Ubuntu or you can use MinGW64. MinGW64 has tigher integration with the window subsystem, so I prefer that.
MingW64 using pacman package manager to install applications. Check https://packages.msys2.org/package/ for available packages. Here's a recipe.
- Install Python from Windows Store.
- Install TeX from MikTeX
- Install pandoc
Now follow instructions in "Installing webify and configuring commandline usage" above.
Please contact Faisal Qureshi at faisal.qureshi@ontariotechu.ca.