How to use the @vuese/markdown-render.Render function in @vuese/markdown-render

To help you get started, we’ve selected a few @vuese/markdown-render examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SAP / fundamental-vue / src / tools / index.js View on Github external
const _writeMarkdown = ({ filename, outputDir, result }) => {
  const destination = Path.format({
    dir: outputDir,
    name: filename,
    ext: ".md"
  });
  const render = new Render(result);
  const markdown = render.renderMarkdown() || {};
  // @ts-ignore
  fs.writeFileSync(destination, markdown.content || "");
};
const writeApi = ({ result }) => {
github BuptStEve / markdown-it-vuese / src / index.js View on Github external
function getMdFromSfc (filePath) {
        if (!fs.existsSync(filePath)) return `Not found: ${filePath}`

        try {
            const content = fs.readFileSync(filePath, 'utf-8')
            const parserRes = vueseParser(content, parserOptions)

            if (isFn(useParser)) return useParser(parserRes)

            const vueseRender = new VueseRender(parserRes, renderOptions)

            if (isFn(useRender)) return useRender(vueseRender)

            const renderRes = vueseRender.render()
            const markdownRes = vueseRender.renderMarkdown()

            return isFn(useAll)
                ? useAll({ content, parserRes, renderRes, markdownRes })
                : markdownRes.content
        } catch (e) {
            return e.message
        }
    }
}

@vuese/markdown-render

Render raw markdown string according to AST

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Popular @vuese/markdown-render functions