legoman
Simple static website generator.
Supports TOC, image captions, LaTeX, code highlighting and tables.
Quickstart
pip install legoman
# in an empty directory
legoman init
make html
# run devserver (requires inotify-tools)
make devserver
How it works
Files in the root directory are rendered and copied to output/, so the directory structure of your rendered website matches the structure of your source files.
For example, a project with this structure:
[project_root]
โโโ codehilite.css
โโโ index.j2
โโโ projects
โย ย โโโ bar_proj
โย ย โย ย โโโ index.md
โย ย โโโ foo_proj
โย ย โโโ cheetos_small.png
โย ย โโโ index.md
โโโ styles.css
yields this output/
output
โโโ codehilite.css
โโโ index.html
โโโ projects
โย ย โโโ ...
legoman
Simple static website generator.
Supports TOC, image captions, LaTeX, code highlighting and tables.
Quickstart
pip install legoman
# in an empty directory
legoman init
make html
# run devserver (requires inotify-tools)
make devserver
How it works
Files in the root directory are rendered and copied to output/, so the directory structure of your rendered website matches the structure of your source files.
For example, a project with this structure:
[project_root]
โโโ codehilite.css
โโโ index.j2
โโโ projects
โย ย โโโ bar_proj
โย ย โย ย โโโ index.md
โย ย โโโ foo_proj
โย ย โโโ cheetos_small.png
โย ย โโโ index.md
โโโ styles.css
yields this output/
output
โโโ codehilite.css
โโโ index.html
โโโ projects
โย ย โโโ bar_proj
โย ย โย ย โโโ index.html
โย ย โโโ foo_proj
โย ย โโโ cheetos_small.png
โย ย โโโ index.html
โโโ styles.css
CGI
Legoman can also render files individually, which is useful for CGI scripts on a webserver.
TEMPLATE_DIR=/path/to/templates legoman_cgi example.md
Or for serving markdown with lighttpd:
$HTTP["url"] =~ "\.md$" {
setenv.set-environment = ("TEMPLATE_DIR" => "/path/to/templates/")
cgi.assign = (
".md" => "/path/to/legoman_cgi",
".j2" => "/path/to/legoman_cgi",
)
}
Usage
Usage: legoman [OPTIONS] COMMAND [ARGS]...
Options:
--debug
--content_dir PATH
--output_dir PATH
--template_dir PATH
--help Show this message and exit.
Commands:
build generate content
init initialize project
single render single file
See also
- Hugo - similar idea, but written in Go and uses Goโs templating engine
- Dozens of other static website generators