Pi66

merodi
A markdown-based static site generator.
git clone https://git.pi66.xyz/merodi

← back to log

docs: update README.md

author: pi66
date: 2026-06-27 12:14
hash: 072fa74c3c1f73c5166db2ab69ddb346311e0dae

Diffstat:

M

README.md
92 +++++++++++++++++++++++-------
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
diff --git a/README.md b/README.md
index e81edf6..4c9a3b0 100644
--- a/README.md
+++ b/README.md
@@ -1,23 +1,29 @@
 # Merodi

 A markdown-based static site generator built with Python.
+Write pages in markdown, style them with Jinja2 templates, and get a ready-to-publish website.

-## Build
+## Install

-- with pip
+```bash
+pip install .
 ```
-pip(x) install .
+
+## Quick start
+
+```bash
+merodi init my-site
+cd my-site
+merodi build
 ```

-## Usage
+Open `src/dest/index.html` or run `merodi webview` for a live preview.

-### Init a new project
+## Commands

-```
-merodi init <path>  # default is the current directory
-```
+### `merodi init [path]`

-Creates:
+Scaffolds a new project (defaults to the current directory):

 ```
 my-site/
@@ -33,30 +39,56 @@ my-site/
     dest/
 ```

-### Build
+### `merodi build [path]`

-Build the entire project:
+Builds all markdown files from `src/md/` into HTML files in `src/dest/`.

-```
-merodi build <path>  # default is the current directory
-```
+| Flag | Description |
+|---|---|
+| `--file INPUT OUTPUT` | Build a single markdown file |
+| `--release` / `--debug` | Build mode (currently reserved for future use) |

-Build a single file:
+### `merodi webview [path]`

-```
-merodi build --file input.md output.html
+Opens a native GUI window with live preview. Changes to markdown, templates, static files, or plugins automatically rebuild and reload the page.

-### Webview (live preview)
+## Markdown features

+Merodi supports a wide set of markdown extensions:
+
+- **Standard extras** — tables, footnotes, definition lists, fenced code blocks, abbreviations, attr_list, and more
+- **Math** — LaTeX math rendered as MathML (`<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo>&#x0002E;</mo><mo>&#x0002E;</mo><mo>&#x0002E;</mo></mrow></math>` for inline, `<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo>&#x0002E;</mo><mo>&#x0002E;</mo><mo>&#x0002E;</mo></mrow></math>` for blocks)
+- **Syntax highlighting** — Pygments-based, style configurable in `config.toml`
+- **Inline highlights** — `==highlighted text==`
+- **Strikethrough** — `~~strikethrough~~`
+- **Better emphasis** — smart handling of `*` and `_`
+- **Magic links** — URLs auto-link without wrapping syntax
+- **Keyboard keys** — `Ctrl+Alt+Del` renders styled keyboard keys
+- **Details/summary** — collapsible `<details>` blocks
+- **Tabbed content** — tabbed code blocks and sections
+- **Critic markup** — track suggested edits with `delete` and `add`
+- **Attribute lists** — use `[.class]` or `[:#id]` instead of `{.class}` / `{:#id}`
+
+## Templates
+
+Pages are rendered with **Jinja2**. Template files live in `src/templates/`. Your layout can use Jinja2 blocks and other features.
+
+### Plugin functions in templates
+
+Functions defined in `src/plugins.py` are available as globals in your templates:
+
+{% raw %}
+```jinja2
+{{ fetch("https://api.example.com/data", type="json") }}
+{{ read("src/data/content.txt") }}
 ```
-merodi webview <path>  # default is the current directory
-```
+{% endraw %}

-Opens a GUI window with live reload on file changes.
+The default `plugins.py` provides `fetch(url, type)` for HTTP requests and `read(file)` for local files. Add your own functions — any public name (no leading underscore) is automatically available.

 ## Configuration

-Project settings are defined in `config.toml`:
+Project settings live in `config.toml`:

 ```toml
 [project]
@@ -76,4 +108,20 @@ host        = "localhost"
 port        = 8866
 html_path   = "/"
 static_path = "/static"
+
+[extras]
+highlight = "monokai"
 ```
+
+### `[extras]` options
+
+| Key | Default | Description |
+|---|---|---|
+| `highlight` | `"monokai"` | Pygments style name. Set to `"noclasses"` to use CSS classes instead of inline styles. |
+
+## Global flags
+
+| Flag | Description |
+|---|---|
+| `--verbose` | Show detailed error information (also via `VERBOSE=true`) |
+| `--no-color` | Disable colored output (also via `NO_COLOR=true`) |