Skip to content

Commit

Permalink
rename project
Browse files Browse the repository at this point in the history
  • Loading branch information
hojas committed Dec 31, 2023
1 parent 3dd63ef commit aafe859
Show file tree
Hide file tree
Showing 17 changed files with 963 additions and 530 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# vue-md-render
# vue-markdown-viewer

![npm](https://img.shields.io/npm/v/vue-md-render) ![npm](https://img.shields.io/npm/dw/vue-md-render)
![npm](https://img.shields.io/npm/v/vue-markdown-viewer) ![npm](https://img.shields.io/npm/dw/vue-markdown-viewer)

Vue component to render markdown with [remark](https://github.com/remarkjs/remark).

## Install

```shell
$ npm install vue-md-render
$ npm install vue-markdown-viewer
```

## Use

```vue
<script lang="ts" setup>
import { ref } from 'vue'
import { VueMdRender } from 'vue-md-render'
import { VueMdRender } from 'vue-markdown-viewer'
const md = ref('## hi')
</script>
Expand All @@ -30,7 +30,7 @@ Use a plugin to support gfm:
```vue
<script lang="ts" setup>
import { ref } from 'vue'
import { VueMdRender } from 'vue-md-render'
import { VueMdRender } from 'vue-markdown-viewer'
import remarkGfm from 'remark-gfm'
const md = ref('## hi')
Expand All @@ -48,7 +48,7 @@ Use a plugin to support syntax highlight:
````vue
<script lang="ts" setup>
import { ref } from 'vue'
import { VueMdRender } from 'vue-md-render'
import { VueMdRender } from 'vue-markdown-viewer'
import rehypeHighlight from 'rehype-highlight'
const md = ref(`
Expand Down
33 changes: 17 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "vue-md-render",
"name": "vue-markdown-viewer",
"type": "module",
"version": "1.0.3",
"packageManager": "pnpm@8.10.2",
"version": "1.0.0",
"packageManager": "pnpm@8.13.1",
"license": "MIT",
"repository": "hojas/vue-md-render",
"bugs": "https://github.com/hojas/vue-md-render/issues",
"repository": "hojas/vue-markdown-viewer",
"bugs": "https://github.com/hojas/vue-markdown-viewer/issues",
"keywords": [
"remark",
"unified",
Expand All @@ -20,19 +20,20 @@
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/vue-md-render.js",
"require": "./dist/vue-md-render.umd.cjs"
"import": "./dist/vue-markdown-viewer.js",
"require": "./dist/vue-markdown-viewer.umd.cjs"
}
},
"main": "./dist/vue-md-render.umd.cjs",
"module": "./dist/vue-md-render.js",
"main": "./dist/vue-markdown-viewer.umd.cjs",
"module": "./dist/vue-markdown-viewer.js",
"types": "./dist/index.d.ts",
"files": ["dist"],
"scripts": {
"dev": "node ./scripts/dev.cjs",
"build": "node ./scripts/build.cjs",
"build:demo": "node ./scripts/build-demo.cjs",
"lint": "eslint ."
"lint": "eslint .",
"push": "pnpm build && npm publish"
},
"dependencies": {
"rehype-stringify": "^10.0.0",
Expand All @@ -41,12 +42,12 @@
"unified": "^11.0.4"
},
"devDependencies": {
"@antfu/eslint-config": "^1.1.0",
"@types/node": "^20.9.0",
"eslint": "^8.53.0",
"@antfu/eslint-config": "^2.6.1",
"@types/node": "^20.10.6",
"eslint": "^8.56.0",
"shelljs": "^0.8.5",
"typescript": "^5.2.2",
"vite": "^4.5.0",
"vue-tsc": "^1.8.22"
"typescript": "^5.3.3",
"vite": "^5.0.10",
"vue-tsc": "^1.8.27"
}
}
2 changes: 1 addition & 1 deletion packages/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>vue-md-render demo</title>
<title>vue-markdown-viewer demo</title>
</head>
<body>
<div id="app"></div>
Expand Down
14 changes: 7 additions & 7 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "vite build"
},
"dependencies": {
"github-markdown-css": "^5.4.0",
"github-markdown-css": "^5.5.0",
"highlight.js": "^11.9.0",
"katex": "^0.16.9",
"mermaid": "^10.6.1",
Expand All @@ -18,13 +18,13 @@
"remark-gfm": "^4.0.0",
"remark-math": "^6.0.0",
"remark-toc": "^9.0.0",
"vue": "^3.3.8",
"vue-md-render": "workspace:*"
"vue": "^3.4.3",
"vue-markdown-viewer": "workspace:*"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.4.1",
"typescript": "*",
"vite": "*",
"vue-tsc": "*"
"@vitejs/plugin-vue": "^5.0.2",
"typescript": "^5.3.3",
"vite": "^5.0.10",
"vue-tsc": "^1.8.27"
}
}
4 changes: 2 additions & 2 deletions packages/demo/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import 'github-markdown-css'
import 'github-markdown-css/github-markdown-dark.css'
import 'highlight.js/styles/night-owl.css'
import 'katex/dist/katex.css'
import remarkGfm from 'remark-gfm'
Expand All @@ -10,7 +10,7 @@ import rehypeRaw from 'rehype-raw'
import rehypeHighlight from 'rehype-highlight'
import rehypeKatex from 'rehype-katex'
import { VueMdRender } from 'vue-md-render'
import { VueMdRender } from 'vue-markdown-viewer'
import MermaidRender from './components/MermaidRender.vue'
import NormalCode from './components/NormalCode.vue'
import content from './demo.md?raw'
Expand Down
14 changes: 7 additions & 7 deletions packages/demo/src/demo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# A demo of `vue-md-render`
# A demo of `vue-markdown-viewer`

`vue-md-render` is a markdown component for Vue.
`vue-markdown-viewer` is a markdown component for Vue.

## Overview

Expand All @@ -22,12 +22,12 @@ Here is an example of a plugin to highlight code: [rehype-highlight](https://git

```html
<script lang="ts" setup>
import { VueMdRender } from 'vue-md-render'
import { VueMdRender } from 'vue-markdown-viewer'
import rehypeHighlight from 'rehype-highlight'
</script>

<template>
<vue-md-render :rehype-plugins="[rehypeHighlight]"># Your markdown here</vue-md-render>
<vue-markdown-viewer :rehype-plugins="[rehypeHighlight]"># Your markdown here</vue-markdown-viewer>
</template>
```

Expand Down Expand Up @@ -106,14 +106,14 @@ You can pass components to change things:

```html
<script lang="ts" setup>
import { VueMdRender } from 'vue-md-render'
import { VueMdRender } from 'vue-markdown-viewer'
import MyFancyRule from './components/my-fancy-rule.js'
const renderHr = (properties) => MyFancyRule
</script>

<template>
<vue-md-render
<vue-markdown-viewer
:components="{
<!-- Use h2s instead of h1s -->
h1: 'h2',
Expand All @@ -122,6 +122,6 @@ const renderHr = (properties) => MyFancyRule
}"
>
# Your markdown here
</vue-md-render>
</vue-markdown-viewer>
</template>
```
2 changes: 1 addition & 1 deletion packages/demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
base: '/vue-md-render/',
base: '/vue-markdown-viewer/',
plugins: [vue()],
})
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "vue-md-render",
"name": "vue-markdown-viewer",
"type": "module",
"private": true,
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/vue-md-render.js",
"require": "./dist/vue-md-render.umd.cjs"
"import": "./dist/vue-markdown-viewer.js",
"require": "./dist/vue-markdown-viewer.umd.cjs"
}
},
"main": "./dist/vue-md-render.umd.cjs",
"module": "./dist/vue-md-render.js",
"main": "./dist/vue-markdown-viewer.umd.cjs",
"module": "./dist/vue-markdown-viewer.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "vite build && vue-tsc --declaration --emitDeclarationOnly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function renderElement(ast: AST & { type: 'element' }, options: Options): VNode
ast.tagName,
ast.properties,
ast.children
&& ast.children.map((child: Child) => astToVNode(child, options)),
&& ast.children.map((child: Child) => astToVNode(child, options)),
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { App } from 'vue'
import VueMdRender from './vue-md-render.vue'
import VueMdRender from './vue-markdown-viewer.vue'

export { VueMdRender }

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default defineConfig({
lib: {
entry: 'src/index.ts',
name: 'VueMdRender',
fileName: 'vue-md-render',
fileName: 'vue-markdown-viewer',
},
rollupOptions: {
external: ['vue'],
Expand Down
Loading

0 comments on commit aafe859

Please sign in to comment.