`, a standalone
`
`) in ``, but CommonMark emits it as a bare HTML block. You can't relax
this away (`
` is usually meaningful). `block()` removes the `
` but injects
`style="display:block"`. The clean fix is `raw-html`, which lands as a bare
block:
```typ
#let tagline(body) = raw-html("" + plain-text(body) + "")
// a stray
in content: #raw-html("
")
```
### Smart quotes
Typst applies smart quotes to **markup** (string literals are left alone), and
differs from zola in a couple of spots. To opt a region out entirely, use the
`smartquote` set rule:
```typ
#set smartquote(enabled: false) // straight quotes in this scope
```
That's the clean fix for your own chrome (a literal `That's all`). Note one
remaining divergence to watch in body text: an apostrophe after a digit becomes
a **prime** `′` in Typst (e.g. `P3's` → `P3′s`); fix the source text (`P3’s`)
on the affected page.
### The `asset` module gets shadowed
If a shortcode takes an `asset:` parameter (a path string), it shadows the
global `asset` module inside that function. Capture it at module scope:
```typ
#let asset-url(path) = asset.file(path).url() // top level, before the shortcode
```
### Unpadded dates
Zola prints `2023-2-6`, not `2023-02-06`:
```typ
#d.display("[year]-[month padding:none]-[day padding:none]")
```
### Syntax highlighting
`
` is diffed **text-only**, so token-level highlight differences are
tolerated (you may see an `attr-drift` *warning*; ignore it). Two real
differences from zola/syntect to handle:
- Typst doesn't emit inline `color`/`background-color` on the `` the way
syntect does — so a code block renders unstyled until you give `pre` a
`color`/`background` in your **CSS/SASS**.
- Typst picks the highlight theme from a `set raw(theme: ".../Some.tmTheme")`
rule (a TextMate `.tmTheme` file in the project), applied on the body — it
does not read zola's `highlight_theme` config. Drop a `.tmTheme` in
`templates/` and point `set raw` at it.
---
## Reading the diff
- `-` is **expected** (the ground truth); `+` is what **Twyla produced**.
- **Whitespace is fully relaxed** — never chase indentation or blank lines.
- `` compares **text-only**; `| / | ` ignore `style`.
- URL-bearing attributes (`src`, `srcset`, sub-resource `href`) are
**value-relaxed** — the link audit proves they resolve, so you don't have to
match fingerprinted asset URLs. `` to a *page* stays strict.
- Scope with `--only ` while iterating on one page.
- The audit reports `broken-link` / `unreachable` for internal URLs Twyla
doesn't produce, and `feed-todo` for feeds (not yet implemented).
---
## Treat the drafts as yours
`twyla convert` gives you a **starting point**, not a maintained source. Once a
page is drafted, the `.typ` is yours: iterate on it directly, the same way you
iterate on the templates. Don't get stuck trying to make the importer emit
exactly the right thing — fixing a stray construct in one draft is usually
faster and is what an end user would actually do.
Reserve escalation for diffs that seem **unreasonable to resolve** — where the
ground truth itself looks wrong, or matching it would mean fighting Typst. The
canonical example: zola putting rendered HTML back into a ``
attribute that should be plain text. That's a case to flag to the project owner
(relax the diff, or accept it) rather than engineer around. When in doubt about
whether a diff is worth chasing, ask.
> If you do regenerate drafts after the converter improves, note that
> `convert --overwrite` rewrites **all** of them and discards hand-edits; use
> `twyla md2typ ` to re-translate a single page to stdout instead.
|