mambler/README.md

45 lines
2.5 KiB
Markdown
Raw Normal View History

2025-10-20 22:25:49 +03:00
```
.        :    :::.     .        :   :::::::.   :::    .,:::::: :::::::..   
;;,.    ;;;   ;;`;;    ;;,.    ;;;   ;;;'';;'  ;;;    ;;;;'''' ;;;;``;;;;  
[[[[, ,[[[[, ,[[ '[[,  [[[[, ,[[[[,  [[[__[[\. [[[     [[cccc   [[[,/[[['  
$$$$$$$$"$$$c$$$cc$$$c $$$$$$$$"$$$  $$""""Y$$ $$'     $$""""   $$$$$$c    
888 Y88" 888o888   888,888 Y88" 888o_88o,,od8Po88oo,.__888oo,__ 888b "88bo,
MMM  M'  "MMMYMM   ""` MMM  M'  "MMM""YUMMMP" """"YUMMM""""YUMMMMMMM   "W" 
```
`mambler` converts a Markdown document (and any local Markdown files it links to) into an Ancient Machine Book (AMB) ready for distribution.
2025-10-20 20:54:19 +03:00
2025-10-20 22:25:49 +03:00
The project wraps the [md2txt](https://github.com/randogoth/md2txt/) toolchain, using its Markdown parser and AMA renderer to generate the article content.
`mambler` then packs the rendered output into the AMB binary format, handling large documents by automatically splitting them into multiple AMA files with navigational “Continue” links.
2025-10-20 20:54:19 +03:00
2025-10-20 22:25:49 +03:00
### Installation
2025-10-20 20:54:19 +03:00
2025-10-20 22:47:29 +03:00
Install the CLI directly from GitHub with [uv](https://github.com/astral-sh/uv):
2025-10-20 20:54:19 +03:00
2025-10-20 22:25:49 +03:00
```
uv tool install --from github:randogoth/mambler mambler
```
2025-10-20 20:54:19 +03:00
### Usage
```bash
2025-10-20 22:47:29 +03:00
mambler --title "Your Book Title" --codepage 437 path/to/index.md output.amb
2025-10-20 20:54:19 +03:00
```
- `index.md` is the root Markdown file. Any local Markdown links it contains will be followed and bundled automatically.
- `--title` is optional; when provided the value is embedded in the AMB archive header (truncated to 64 ASCII bytes).
2025-10-20 21:43:08 +03:00
- `--codepage` controls the 8-bit encoding used for every AMA article (default: `437`). Any character that cannot be expressed in the chosen codepage aborts the build with a helpful error so you can pick a better fit.
- If any emitted byte lives in the 0x800xFF range, `mambler` automatically writes a companion `UNICODE.MAP` file describing the high-half character mapping, mirroring the recommendation in the AMA/AMB specification.
2025-10-20 21:58:05 +03:00
- Words of length 217 are indexed into `DICT.IDX` so readers can offer fast full-text search. The index is omitted if it would overflow the 64KiB LoW data limit mandated by the spec.
2025-10-20 20:54:19 +03:00
- The command prints the path of the generated AMB file on success.
### Development Notes
2025-10-20 22:47:29 +03:00
- Run `uv run python -m compileall src/mambler` to ensure the package still compiles.
2025-10-20 22:25:49 +03:00
- The `md2txt` dependency is fetched from GitHub; contribute renderer/parser changes upstream in that project.
2025-10-20 20:54:19 +03:00
2025-10-20 22:25:49 +03:00
---
2025-10-20 20:54:19 +03:00
2025-10-20 22:25:49 +03:00
* Directed and vibe coded by Tobias Raayoni Last
* Programmed by `gpt-5-codex`