You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The filter was rewritten from scratch around a two-stage pipeline:
8
+
9
+
***Stage 1 — Normalize**: each reader (`normalize_github`, `normalize_div`) converts its input format into a canonical intermediate div with `kind`, `title`, and `collapse` attributes. No output format knowledge needed.
10
+
***Stage 2 — Write**: `write_callout` dispatches to the correct writer via a `Writers` table keyed by `Container` enum. Each writer only knows its own syntax.
11
+
12
+
This replaces the original single-function approach (`make_div`) that mixed reading, normalizing, and writing into one path with two hardcoded outputs. The new design makes adding a format a matter of adding one row to `FormatDefaults` and one writer function, with no changes to existing code.
13
+
14
+
### Breaking changes
15
+
16
+
* Metadata key redesigned. The old boolean-flag form (`quarto-format: true`) is replaced by a clean string or nested map:
17
+
18
+
```yaml
19
+
# simple string — works on command line and in frontmatter
* **`pandoc-md` intermediate format**: attribute-based div representation for round-trip pipelines between readable formats.
34
+
* **Collapse support**: `[!NOTE]-` (collapsed) and `[!NOTE]+` (expanded) markers are normalized to `collapse="true/false"` and round-trip correctly through all readable formats. Write-only formats use their native collapse syntax (`???` for MkDocs, `dropdown` for MyST, `:::details` for VitePress/Docusaurus).
35
+
* **Inline title capture**: `> [!NOTE] My title` extracts the title correctly from the marker line.
36
+
* **Any casing accepted**: `[!NOTE]`, `[!Note]`, `[!note]` all normalize identically.
37
+
* **Quarto div normalizer**: `:::{.callout-*}` divs are read and converted to the intermediate format, enabling Quarto → any format pipelines.
38
+
* **Pandoc 3.9 / Sphinx normalizer**: `:::{.note}` plain classed divs with optional `.title` child or `title=` attribute are recognized.
39
+
* **Extended callout type whitelist**: 25 built-in types covering all major ecosystems (Obsidian, MkDocs, MyST, Sphinx, VitePress).
40
+
* **`custom-types`** frontmatter option: add types beyond the built-in whitelist without modifying the filter.
41
+
* **Quarto source roundtrip**: `quarto-format` → `pandoc-md` → `quarto-format` verified to produce identical output.
42
+
* **Test metadata files** updated to new `out-format` nested form.
43
+
* **Dispatcher pattern**: one `write_callout` entry point routes to the correct writer via a `Writers` table keyed by container type.
44
+
45
+
### Changed
46
+
47
+
* Title handling mimics pandoc 3.9: the `.title` Div child is only inserted when the user explicitly sets a title. No auto-generation from the type name.
48
+
* `write_blockquote` produces pure AST objects — `RawInline("markdown", ...)` for the marker prevents Pandoc from escaping `[` as `\[`, and `BlockQuote` wraps the content instead of `RawBlock` markdown text. Enables correct round-trip parsing.
49
+
* Format defaults extracted into a `FormatDefaults` table — no more `if/elseif` chain.
50
+
* Magic strings replaced by `TypeCase` and `Container` enums with runtime error protection against typos.
51
+
52
+
## \[0.1.0]
53
+
54
+
* Converts `> [!WORD]` GitHub alert blockquotes to classed Divs.
55
+
* Two output paths: Quarto (`callout-*` class + `title` attribute) and plain Pandoc (bare class + `.title` Div child).
56
+
* Auto-detects Quarto via the `quarto` global.
57
+
* Accepts uppercase `[!NOTE]` markers only.
58
+
* Per-document options via `quarto-format: true` / `pandoc-format: true` flags.
0 commit comments