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/github/issues/andrenasturas/hausse/bug https://img.shields.io/github/license/andrenasturas/hausse
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:
elementsis a Element list. A Element represents a file, with its own metadata accessible as object attributes, and content stored in._contentsattribute.metadatais a dictionary of global metadata.settingsis 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe1a5036f9ab172eb70d32f21b8b4af150368cbd8b8b4e57fb471d44f65340c8
|
|
| MD5 |
1423ffbedcfa3f269c2abbc18fd728a1
|
|
| BLAKE2b-256 |
2cc74b3ddd7a1ba015df7fcc62c796c9dec3f9599c794666b96738aa73c3bd4f
|