@abraca/convert
@abraca/convert
The canonical Markdown ↔ Yjs/TipTap round-trip converter — shared by cou-sh, abracadabra-nuxt, and @abraca/mcp instead of each vendoring its own copy. Zero runtime dependencies (yjs peer-only).
Documentation
Full, code-derived documentation lives in docs/ — the node/mark spec, the
universal-meta spec, the conversion API, diff + file-blocks, and a precise
fidelity/gotchas reference. It is the source of truth (the old SPEC.md was untrusted
and removed).
API
import { populateYDocFromMarkdown, yjsToMarkdown } from "@abraca/convert";
populateYDocFromMarkdown(doc.getXmlFragment("default"), markdown);
const { title, markdown } = /* via */ yjsToMarkdown(fragment, label);
Fragment shape: [documentHeader, documentMeta, ...body]. Also populateYDocFromHtml (needs a global DOMParser), yjsToHtml, yjsToPlainText, structural diff.ts, and the FS-sync file-blocks/ sidecar.
::
Attach-before-fill is load-bearing —
Y.XmlText.inserton a detached node reverses text (YATA clock 0). Coverage is partial: several spec nodes/marks have no runtime branch, and frontmatter handles a ~13-key subset. Seedocs/4.reference/.
License
MIT.
Related Packages
Website-builder Nuxt module for the Abracadabra CRDT platform — page-type render...
Version History
| Version | Released | License |
|---|---|---|
| 2.102.0 | MIT | |
| 2.101.0 | MIT | |
| 2.100.0 | MIT | |
| 2.99.0 | MIT | |
| 2.97.0 | MIT | |
| 2.96.0 | MIT | |
| 2.95.0 | MIT | |
| 2.93.0 | MIT | |
| 2.92.0 | MIT | |
| 2.91.0 | MIT | |
| 2.90.0 | MIT | |
| 2.89.0 | MIT | |
| 2.88.0 | MIT | |
| 2.87.0 | MIT | |
| 2.86.0 | MIT | |
| 2.85.0 | MIT | |
| 2.84.0 | MIT | |
| 2.83.0 | MIT | |
| 2.82.0 | MIT | |
| 2.81.0 | MIT | |
| 2.80.0 | MIT | |
| 2.79.0 | MIT | |
| 2.78.0 | MIT | |
| 2.77.0 | MIT | |
| 2.76.0 | MIT | |
| 2.75.0 | MIT | |
| 2.74.0 | MIT | |
| 2.73.0 | MIT | |
| 2.72.0 | MIT | |
| 2.71.0 | MIT |
Showing the latest 30 of 97. See every release on npm