MCPcopy Create free account
hub / github.com/DimwitLabs/ode / parseMarkdown

Function parseMarkdown

src/utils/parseMarkdown.js:3–17  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

1import fm from "front-matter";
2
3export async function parseMarkdown(path) {
4 const response = await fetch(path);
5
6 if (!response.ok) {
7 throw new Error(`Failed to load ${path}: ${response.status}`);
8 }
9
10 const raw = await response.text();
11 const parsed = fm(raw);
12
13 return {
14 frontmatter: parsed.attributes,
15 content: parsed.body
16 };
17}

Callers 2

IntroFunction · 0.90
loadPageFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected