MDiocre
A very simple static website generator tool powered by Python. It primarily converts Markdown files and combines it with an HTML template, but can be extended to other markup.
Requirements
- Python 3 (
python-markdown+py-gfm)
Other Requirements
ReStructuredText (RST) support requires docutils to be installed.
If you want to build the documentation, you will have to install Sphinx as well.
What sets it apart from other tools?
It's terrible and it doesn't have a profitable and pragmatic usecase in mind, but it works okay. For my needs, anyway. It's alright for simple blogs with no tagging and very simple static websites.
How do I make a site with this?
-
Install
mdiocreby using the command:python3 -m pip install mdiocre. -
Create a work folder. Let's call it
work. -
Make a file called
template.htmlinside that folder with these contents:<html> <head>Welcome to my website!</head> <body><!--:content--></body> </html> -
Create a folder called
src, and make a file inside of it calledindex.md, and write anything on it. -
After your content (or before, it doesn't matter), add:
<!--:mdiocre-template="../template.html"--> -
Go back a level to your
workfolder. Assuming Python is present in your PATH (environment variable), create a new text document containing:python3 -m mdiocre.interface.cli src buildSave it inside the folder as a .bat if you're on Windows, or as a .sh if you're on Mac, Linux, or other Unix-like systems. Double click or execute it.
-
Check the
buildfolder.
Variables
MDiocre allows setting variables. These variables are per-page, and can be read by the template. Both the template and the markdown page share the same format for templates - which are HTML comments with the first character after the markup being the colon (:)
Setting a variable to a string
<!--: hello = "test message" -->
Simply sets hello to test message. When using a comma, make sure to escape it with \!
Setting a variable to another variable
<!--: hello = lemons -->
If lemons is 1 then hello will also be 1. If lemons is not set, hello will contain the string lemons.
Concatenating two or more variables
<!--: lemons = hello, hello -->
If hello contains abc then lemons will contain abcabc. However, if you also include a space string in between, like this...
<!-- lemons = hello, " ", hello -->
lemons will contain abc abc!
Metadata
Release files for mdiocre 3.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mdiocre-3.5.3.tar.gz | 22.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mdiocre-3.5.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.9 kB
Release files / mdiocre-3.5.3.tar.gz
| Download URL | mdiocre-3.5.3.tar.gz |
|---|---|
| Size | 22.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
295b1d1a322afa2703a709b590531005ba069f039f4df367ee5f4bbc7aa3cdba
|
|
BLAKE2b-256 checksum How to use checksums |
4c0b7b8fced8c37d1da633554ea438b0cbd764987c30882501ba87a59490ccec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / mdiocre-3.5.3-py3-none-any.whl
| Download URL | mdiocre-3.5.3-py3-none-any.whl |
|---|---|
| Size | 23.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
61e8493d542269cd657563ae478be4d3a206b96bba9521a21352b8c95221f044
|
|
BLAKE2b-256 checksum How to use checksums |
f61a01f5e9ee87764a307006eb639d00eb82ccf6744dd01529e44aec8b7402fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|