export function parseDocumentFromBuffer()

in library/markdown-parser/models/document.ts [65:73]


export function parseDocumentFromBuffer(name: string, buffer: Buffer): Document {
  try {
    const { title, type, version, weight, __content } = parseMarkdownWithYAML(buffer);
    return new Document(title, type, __content, name, version, weight);
  } catch (e) {
    console.log(e);
    throw new Error(name);
  }
}