0.2.13 • Published 2 years ago

@xieyuheng/postmark-components-vue3 v0.2.13

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Postmark Components -- for Vue3

Components for rendering Postmark Nodes.

By which your can provide custom components to render your markdown extensions.

Demo

We have a demo page at:

Usage

You can copy the code in src/components to your project, and use them as the base for your highly customized markdown renderer.

You can also install this package:

npm i @xieyuheng/postmark-components-vue3

And import the components as the following:

import { components } from "@xieyuheng/postmark-components-vue3"

// Or use `require` to import and use `components` in one line:
require("@xieyuheng/postmark-components-vue3").components

A complete example:

  • Where the @/components/cicada-block is a custom component for rendering cicada code block.
<md-document
  :document="state.document"
  :custom-block-components="{
    Cicada: {
      component: require('@/components/cicada-block').default,
      props: (node) => ({
        text: node.text.trim(),
        index: node.value.index,
        info: node.info,
        loadMod: () => state.mod,
      }),
    },
  }"
/>

Contributions

Be polite, do not bring negative emotion to others.

License