Skip to main content

Plugin-based static project generator

Project description

Hausse

Hausse is a python plugin-based static site generator. It works with plugins that can be chained to process files and produce the wanted result.

https://img.shields.io/pypi/v/hausse GitHub top language GitHub code size in bytes https://img.shields.io/github/issues/andrenasturas/hausse/bug https://img.shields.io/github/license/andrenasturas/hausse Code Climate maintainability Read the Docs

Installation

pip install hausse

How it works

First, create a Hausse project.

project = Hausse()

Then, use the plugins you need. For example, if you want to parse markdown files, there is the Markdown plugin.

project.use(Markdown())

You can use multiple plugins for more precise processing.

# If your markdown files have rich metadata values, you can process them too
project.use(MetadataMarkdown("rich_metadata"))
# you may also render your pages with html page layouts
project.use(Handlebars())

Finally, build your project.

project.build()

When your pipeline is done, you can save it to a hausse.json file.

project.save()

This file allows you to build your project directly from command line.

python -m hausse path/of/your/project

That's it !

Examples

Here are a few examples to illustrate the possibilities offered by Hausse and to inspire your future projects

  • Portfolio, a single-page website featuring a résumé, skills overviews and projects showcases.
  • Notes extraction, a presentation of a CSV file of a Notes app data extraction.

What if I need a new plugin ?

Nothing more simple ! Writing a new plugin for Hausse is very easy. A Plugin is nothing more than a python object with a specific __call__ method.

When build() is called on a Hausse project, all Plugins are successively called as functions with the Hausse project object itself as an argument. Its attributes contains everything needed by the plugins:

  • elements is a Element list. A Element represents a file, with its own metadata accessible as object attributes, and content stored in ._contents attribute.
  • metadata is a dictionary of global metadata.
  • settings is a dictionary of technical objects, deposited by some Plugins to be easily usable by others plugins.

You may also implement the __init__ method as you wish to store Plugin parameters that will be needed during the build.

Finally, if you feel like it should be added to hausse plugins, you can create a plugin request.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

hausse-0.3.0-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file hausse-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: hausse-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for hausse-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe1a5036f9ab172eb70d32f21b8b4af150368cbd8b8b4e57fb471d44f65340c8
MD5 1423ffbedcfa3f269c2abbc18fd728a1
BLAKE2b-256 2cc74b3ddd7a1ba015df7fcc62c796c9dec3f9599c794666b96738aa73c3bd4f

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