Scriptable Lua Site Generator
- Fix fennel's function scopes, so they can be used acros scripts
- Project site
- Template for both fennel and lua (index, single post, rss feed)
-
new
command that uses one of the templates -
doc
command that prints out the documentation
Write your files in normal markdown or html. When a file has a *.lua.* or *.fnl.*
in it's extension, it will be processed. In this casy, any <? ... ?>
is interpreted
as lua or fennel, depending on the double extension In markdown files, this is done by
replacing any inline and block html that forms a processing instruction.
Any number or string that is returned from <? ... ?>
expressions are added into the
resulting file.
If a function or table is returned, this function is called after templating is done, with the entire text in the file. The resulting string from the function is then used as the new file content, or is called again if it is a function or table.
Any $...$
and $$...$$
in markdown files are interpreted as TeX math, and converted
to mathml.
Any code block in markdown is highlighted using syntect. Other languages can be loaded via the config file.
Any [name].htm
and [name].html
files are automatically renamed to
[name]/index.htm
and [name]/index.html
Any *.ttf
or *.otf
font can be subset, by changing the extension to *.subset.ttf
or *.subset.otf
The following functions and variables are available from lua and fennel:
-
Set to true if run with the development server, set to false otherwise
dev = true
-
Compile the given tex to mathml. If inline is true, the resulting mathml is inline instead of block.
function mathml(tex, inline) end
-
Highlight the given code
function highlight(language, code, prefix) end
This can all be controlled with the site.conf
config file, which has the following
defaults:
[build]
output = dist/
# setup = script.lua # setup script, run before processing
[ignore]
# scripts/* # files to ignore when building the site
[dev]
# not-found = 404.html # page to use as 404 when developing
[font]
subset = true # whether to subset fonts
# extra = abc # add these characters as extra to subset