ADF to Markdown
Overview
Basic Usage
Using the Main Parser
import { Parser } from 'extended-markdown-adf-parser';
const parser = new Parser();
// ADF document
const adf = {
version: 1,
type: 'doc',
content: [
{
type: 'heading',
attrs: { level: 1 },
content: [{ type: 'text', text: 'Document Title' }]
},
{
type: 'panel',
attrs: { panelType: 'info', title: 'Information' },
content: [
{
type: 'paragraph',
content: [
{ type: 'text', text: 'This is an ' },
{ type: 'text', text: 'important', marks: [{ type: 'strong' }] },
{ type: 'text', text: ' information panel.' }
]
}
]
}
]
};
// Convert to markdown
const markdown = parser.adfToMarkdown(adf);
console.log(markdown);
// Output:
// # Document Title
//
// ~~~panel type=info title="Information"
// This is an **important** information panel.
// ~~~Using Enhanced Parser for Metadata
Available Methods
Synchronous Conversion
Enhanced Parser Methods
Conversion Options
Supported Elements
Document Structure
Headings
Text Formatting
Lists
Tables
Code Blocks
Expand Sections
Media Elements
Social Elements
Metadata Comments
Metadata Comment Formats
Next Steps
Last updated