You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
evan 8c14534e47 bump version 2 weeks ago
demo update function name to getmeta 2 weeks ago
legoman update function name to getmeta 2 weeks ago
.gitignore fixup makefile, install reqs 2 years ago move demo into demo/, cleanup makefile, 2 years ago fix readme header 4 months ago bump version 2 weeks ago


Simple static website generator.

Supports TOC, image captions, LaTeX, code highlighting and tables.



pip install legoman

# in an empty directory
legoman init
make html

# run devserver (requires inotify-tools)
make devserver

How it works

Files in content/ are rendered and copied to output/, so the directory structure of your rendered website matches the structure of your source files.

For example, the demo content/:

├── codehilite.css
├── index.j2
├── projects
│   ├── bar_proj
│   │   └──
│   └── foo_proj
│       ├── cheetos_small.png
│       └──
└── styles.css

yields this output/

├── codehilite.css
├── index.html
├── projects
│   ├── bar_proj
│   │   └── index.html
│   └── foo_proj
│       ├── cheetos_small.png
│       └── index.html
└── styles.css


Legoman can also render files individually, which is useful for CGI scripts on a webserver.

TEMPLATE_DIR=/path/to/templates legoman_cgi

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: legoman [OPTIONS] COMMAND [ARGS]...

  --content_dir PATH
  --output_dir PATH
  --template_dir PATH
  --help               Show this message and exit.

  build   generate content
  init    initialize project
  single  render single file

See also