# 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 ``` Write a document the ordinary way; get back valid WML 1.3 that a 2001 handset can actually navigate. ## Why this is not just another text exporter Most Markdown converters transform a document: same content, different markup, one file in and one file out. A WML deck is not that shape. A WAP screen is a few lines tall, scrolling is painful, and the input device is a numeric keypad — so a deck is a set of short **cards** joined by softkeys and menus, not one long page. So wapdown **restructures**. It decides where cards begin, builds a menu that exists nowhere in your source, wires up Back and More controls, and paginates anything still too big for the device's cache. That is why it has more knobs than a plain text exporter needs: the knobs *are* the tool. ## Install Install the CLI with [uv](https://github.com/astral-sh/uv): ```bash uv tool install --from git+https://codeberg.org/randogoth/wapdown/ wapdown ``` Zero runtime dependencies, Python 3.13+. ## Cards A document with no dividers becomes a single card. There are three ways to ask for more. **Thematic breaks** — a plain `---` starts a new card. WML has no rule element to draw (its entire layout vocabulary is `
`), and a row of ASCII dashes is noise on a small screen, so the glyph is put to better use as the divider it already looks like: ```markdown Intro shown on the menu card... --- ## Weather Cold and clear. --- ## Trail Status - North Loop: open ``` Each card takes its title from its own first heading. `***` and `___` work identically — any Markdown thematic break divides. A trailing `---`, or two in a row, adds no empty card. `--no-split-on-rule` turns this off; breaks are then ignored rather than drawn, because there is still nothing to draw them with. `---` under a line of text is a setext heading, not a break, and is parsed as one — so a document written in that style keeps its headings instead of shattering into cards. **Named dividers** — `{.card Title}` is the same mechanism with an explicit title, for when a section has no heading to borrow one from: ```markdown {.card Trail Status} - North Loop: open ``` The two compose freely in one document. **Heading-level splitting** — `--split-level 2` starts a new card at every `##`, which fits a document that is already structured by headings and has no dividers in it: ```bash wapdown trail.md --split-level 2 ``` Explicit dividers win over `--split-level` when both are present: a boundary written into the document is a stronger statement of intent than a rule passed on the command line. ## Navigation Once a document resolves to two or more cards, wapdown builds the classic WAP-portal shape — a **menu** card listing each section, each spoke reachable in one press and returning with Back: ```bash wapdown trail.md --split-level 2 --menu-style select ``` `--menu-style select` renders those choices as a `