Two Input Paths, One Output Standard
Use main entry for HTML and /docx for direct DOCX import, then keep one Markdown standard for your team.
Turn docsjs snapshots or DOCX into publish-ready Markdown in one flow, with stable output rules for teams and CI.
import { htmlToGfm } from "@coding01/docsjs-markdown";
import { docxToMarkdown } from "@coding01/docsjs-markdown/docx";
const html = docsjsEditor.getSnapshot();
const markdown = htmlToGfm(html, { frontmatter: true });
const fromDocx = await docxToMarkdown(file, { format: "gfm" });Left: docsjs HTML snapshot
<h1>Release Plan</h1>
<p>This sprint shipped parser and render upgrades.</p>
<ul>
<li>DOCX semantic fidelity</li>
<li>List/table parity</li>
<li>Markdown output</li>
</ul>Right: markdown output
# Release Plan
This sprint shipped parser and render upgrades.
- DOCX semantic fidelity
- List/table parity
- Markdown outputhtmlToMarkdown / htmlToGfm / htmlToStandardMarkdowndocxToMarkdown / docxToMarkdownWithMetadocsjs-markdown ./input.docx -o ./output.md --frontmatterUse docsjs for high-fidelity input, docsjs-editor for multi-editor processing, and docsjs-markdown for final markdown delivery.
@coding01/docsjs → @coding01/docsjs-markdown → @coding01/docsjs-editor
npm install @coding01/docsjs-markdownyarn add @coding01/docsjs-markdownpnpm add @coding01/docsjs-markdownimport { htmlToGfm } from "@coding01/docsjs-markdown";
const html = "<h1>Hello</h1><p>World</p>";
const markdown = htmlToGfm(html);
console.log(markdown);Output:
# Hello
Worldimport { docxToMarkdown } from "@coding01/docsjs-markdown/docx";
const file = input.files[0];
const markdown = await docxToMarkdown(file, {
format: "gfm",
frontmatter: true,
});| Package | Description |
|---|---|
| DocsJS | High-fidelity Word/DOCX import |
| DocsJS Editor | Multi-editor integration |