markdown-content-vue

0.0.1 • Public • Published

Markdown content vue

Based on @nuxt/content code.

View instructions on link

Features

  • Parse content
  • Html
  • Vue components
  • Codeblocks (Prismjs)

Install

npm install markdown-content-vue --save

Usage

Import

import { markdownContent, markdownParse } from 'markdown-content-vue'

Template

<markdownContent :document="code" />

Script

Register component

components: {
    markdownContent
}

And parse Markdown

async mounted() {
    const md = new markdownParse()
    const file = '---\ntitle: test\n---\n# Hello World\n ```javascript\n console.log("Hello") \n```\n<HelloWorld></HelloWorld> \n'
    this.code = await md.toJSON(file)
    console.log(this.code)
  },

Beautiful example

Install github-markdown-css

npm install github-markdown-css

Import

import 'github-markdown-css/github-markdown.css'
import 'prismjs/themes/prism-tomorrow.css'

Template

<markdownContent class="markdown-body" :document="code" />

Package Sidebar

Install

npm i markdown-content-vue

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

12.1 kB

Total Files

11

Last publish

Collaborators

  • jerosoler