Skip to main content

a tiny static website generator

Project description

legoman

Simple static website generator.

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

Demo

Quickstart

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/:

content
├── 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

legoman-3.0.5.tar.gz (32.4 kB view hashes)

Uploaded source

Built Distribution

legoman-3.0.5-py3-none-any.whl (32.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page