md2nativedocx

Free and open source · public domain

The engine, in your own code

The libraries behind the extension, the MCP server and this site, on npm and in the public domain: render one diagram as Word XML, convert a whole document from Node, or bring the diagrams into your own Pandoc command.

What it does

Get started

  1. npm install @md2nativedocx/core to render one diagram at a time, or @md2nativedocx/cli for whole documents (with Pandoc installed).

  2. Every exported function and type is documented in its package: your editor shows it as you type.

  3. The code is in the public domain (CC0-1.0). Its architecture and the security rules it follows are on GitHub.

// One diagram, no Pandoc: a Word fragment and the parts it needs
import { renderDiagram } from '@md2nativedocx/core';
const { kind, fragment, parts } = renderDiagram('flowchart LR\n  A --> B');

// A whole document, Pandoc installed: the .docx as a Buffer
import { convert } from '@md2nativedocx/cli';
const { document, warnings } = await convert('# Report\n\n…');

// One slide per Mermaid block: the .pptx as a Buffer
import { exportPptx } from '@md2nativedocx/pptx';
const { buffer } = await exportPptx(markdown);

Other ways to use md2nativedocx