1.0.3 • Published 7 months ago

markdown-vue v1.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
7 months ago

VueJS version of react-markdown

codecov CI workflows

Vue component to render markdown without using innerHTML

Feature highlights

The implementation is 90% shamelessly copied from https://github.com/remarkjs/react-markdown.

Changes include:

  • Replacing React specific component creation with VueJS components
  • Porting the implementation from javascript with JSDoc types to typescript
  • Testing with Vitest instead of nodejs built-in test module
  • Development and preview with Histoire
  • Using Vite instead of esbuild

Please check the original repo for in-depth details on how to use.

Installation

npm install markdown-vue # using npm

yarn add markdown-vue # using yarn

pnpm install markdown-vue # using pnpm

Usage

<script setup lang="ts">
        import VueMarkdown from 'markdown-vue'
</script>

<template>
        <VueMarkdown source="# Hello, *world*!" />
</template>
  • Add markdown-vue/nuxt to the modules section of nuxt.config.ts
export default defineNuxtConfig({
        modules: ['markdown-vue/nuxt']
})
<!-- VueMarkdown is auto imported -->
<template>
        <VueMarkdown source="# Hello, *world*!" />
</template>

Development

# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release

Note

Currently, your page will be crash if you use this component in Nuxt project dev mode and I can't figure out why. If you figure out the solution, please feel free to create a PR. I will gladly to merge it.

TODO

  • Port unit tests from from original library
  • Playground with github page
  • Fix NuxtJs dev error (fixed by @starknt)
1.0.3-rc1

7 months ago

1.0.3

7 months ago

1.0.2

11 months ago

1.0.2-rc05

11 months ago

1.0.2-rc06

11 months ago

1.0.2-rc07

11 months ago

1.0.2-rc08

11 months ago

1.0.2-rc01

11 months ago

1.0.2-rc02

11 months ago

1.0.2-rc03

11 months ago

1.0.2-rc04

11 months ago

1.0.2-rc10

11 months ago

1.0.2-rc11

11 months ago

1.0.2-rc09

11 months ago

1.0.1

1 year ago

0.0.0

1 year ago

1.0.0

1 year ago

0.0.3

6 years ago

0.0.1

6 years ago

0.0.2

6 years ago