# wapdown Compile Markdown into a [WML](https://en.wikipedia.org/wiki/Wireless_Markup_Language) deck for WAP browsers. ```bash wapdown trail.md -o trail.wml ``` A WAP screen is a few lines tall and driven by a numeric keypad, so a deck is a set of short **cards** joined by softkeys — not one long page. wapdown restructures a document into that shape: it decides where cards begin, builds a menu, wires up Back and More, and paginates whatever is still too big. ## Install ```bash uv tool install --from git+https://codeberg.org/randogoth/wapdown/ wapdown ``` Zero runtime dependencies, Python 3.13+. ## Markdown → WML Every mapping, with the markup wapdown actually emits: | Markdown | WML | Notes | | --- | --- | --- | | `# Heading` (first on a card) | `

…

` | | | `## Heading` (and any later heading) | `

…

` | WML has no heading element | | `Text` over `===` / `---` | same as `#` / `##` | setext headings | | Paragraph | `

…

` | the only block container WML has | | `- item` | `

- item

` | no list element; the bullet is literal text | | `1. item` | `

1. item

` | numbering is counted and written out | | `> quote` | `

…

` | | | `---` / `***` / `___` | *(nothing)* | **starts a new card**; WML has no rule element | | `{.card Title}` | *(nothing)* | starts a new card, with a title | | ` ```fenced``` ` / 4-space indent | `

a
b

` | `
` between lines | | `**bold**`, `__bold__` | `…` | | | `*italic*`, `_italic_` | `…` | | | `` `code` `` | *(markers stripped)* | no equivalent | | `~~strike~~` | *(markers stripped)* | no equivalent | | `[label](url)` | `label` | emphasis in the label is stripped | | `![alt](src)` | `alt` | subject to `--images` | | Pipe table | `

…

` | header row bolded | | `{.include file.md}` | *(inlined before conversion)* | | Two quirks of WML's own grammar: - **A literal `$` becomes `$$`.** WML uses `$` for variable substitution. `Permit fee: $5` is emitted as `$$5` and displays as `$5`. - **Link labels cannot carry emphasis.** WML declares `` as `(#PCDATA | br | img)*`, so `[**go** now](url)` becomes `go now`. WML 1.3 is the only supported DTD, by design. ## Cards A document with no dividers is one card. Three ways to split it: **`---`** starts a new card, taking its title from the section's first heading: ```markdown Intro shown on the menu card. --- ## Weather Cold and clear. ``` `***` and `___` work the same. A trailing `---`, or two in a row, adds no empty card. `---` *under* text is a setext heading, not a divider. **`{.card Title}`** is the same thing with an explicit title, for sections with no heading to borrow from. The two compose freely. **`--split-level 2`** starts a card at every `##`, for documents structured by headings alone. Explicit dividers win when both are present. ## Navigation Two or more cards get the classic WAP portal: a **menu** card listing each section, each spoke returning with Back. | Flag | Effect | | --- | --- | | `--menu-style select` | menu choices as a keypad-pickable `