MCPcopy
hub / github.com/JoelOtter/kajero / parse

Function parse

src/js/markdown.js:90–107  ·  view source on GitHub ↗
(md)

Source from the content-addressed store, hash-verified

88}
89
90export function parse(md) {
91 // Separate front-matter and body
92 const doc = fm(md);
93 const {content, blocks} = extractBlocks(doc.body);
94
95 return Immutable.fromJS({
96 metadata: {
97 title: doc.attributes.title,
98 created: getDate(doc.attributes),
99 author: doc.attributes.author,
100 datasources: doc.attributes.datasources || {},
101 original: doc.attributes.original,
102 showFooter: doc.attributes.show_footer !== false
103 },
104 content,
105 blocks
106 });
107}
108
109/*
110 * Functions for rendering blocks back into Markdown

Callers 3

markdown-spec.jsFile · 0.90
notebookFunction · 0.90
loadMarkdownFunction · 0.85

Calls 2

extractBlocksFunction · 0.85
getDateFunction · 0.85

Tested by

no test coverage detected