Skip to main content

Website Assembler Requiring Hardly any Other Libraries -- a minimal static-site builder

Project description

Warhol — Website Assembler Requiring Hardly any Other Libraries

Make a website from Markdown and HTML snippets

Current popular static-website generators are complex beasts, with advanced templating languages, and complicated, fragile and (e.g. Node) dependency-heavy example styles. This package is the antidote: a simple, minimal-dependency package for wrapping HTML and Markdown content pages in site-standard header/footer/etc snippets. It's HTML, not rocket science.

Using Warhol

Use warhol init to initialise a project directory with the basic structure and a simple template.

The warhol build command merges pages from the content/ directory with headers, footers, and box "asides" loaded from the include/ directory. Any Markdown .md files in the content directory tree are converted to HTML, and staged in the .build directory. The final stage is injection of includes and template parameters, which augment the cache contents and write out to the public/ directory.

Parameters are mostly defined as URL-regex maps in the config.toml config file. The default behaviour is for the build step to create a directory and index.html file in place of each (non-index) HTML file, so the webpage URLs do not have .html suffixes; this can be disabled via a regex match in the config file.

The generated site in the public/ directory can be viewed directly with a web browser, but as URLs are internally specified relative to the HTTP server root and index.html pages are assumed to be implicitly loaded, it's best to run a local web server. The warhol serve command does this, from the public/ dir by default.

Example

TODO: walk through init, list dir contents, customize, view

TODO's

  • test and early-exit for either markdown or pandoc if .md's found
  • allow replacement of the site-root leading slash with a configurable string
  • add a global no-extensions on/off flag in config?
  • allow regex capture-group injection into templates... needs subst map?!?
  • parallel processing for MD -> HTML
  • unify build and serve modes behind a single command?
  • use for JustHTML or BeautifulSoup?
  • use inotify to auto-trigger updates?

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

warhol-0.0.3.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

warhol-0.0.3-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file warhol-0.0.3.tar.gz.

File metadata

  • Download URL: warhol-0.0.3.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for warhol-0.0.3.tar.gz
Algorithm Hash digest
SHA256 499e6a94d9c4cfcb2667d76b43627d30643910489f89cda35d19c11a6587a94e
MD5 558ff89602b61063fab0627350df6fb8
BLAKE2b-256 32e392ec75dc266df0002c2c4acb4d0d00548c17ad017308b1fd7092378bd00c

See more details on using hashes here.

File details

Details for the file warhol-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: warhol-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for warhol-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cf0380afdc8a98468ac122a3720011e524a4f39657c4131bb3944539fd66c832
MD5 7a4d30c619318a6de756207b5de492c2
BLAKE2b-256 6f30dcaff514858f3c40b2474c7ab5244c59b25d5ff797db514e866f8f95642e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page