Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Prettier | 47,322 | 184,190 | 247,910 | 9 hours ago | 142 | November 13, 2023 | 1,297 | mit | JavaScript | |
Prettier is an opinionated code formatter. | ||||||||||
Marktext | 41,514 | 2 months ago | 1 | January 19, 2022 | 1,041 | mit | JavaScript | |||
📝A simple and elegant markdown editor, available for Linux, macOS and Windows. | ||||||||||
Slidev | 29,051 | 118 | 3 days ago | 312 | November 16, 2023 | 53 | mit | TypeScript | ||
Presentation Slides for Developers | ||||||||||
Docsify | 25,554 | 278 | 186 | 6 days ago | 193 | June 24, 2023 | 277 | mit | JavaScript | |
🃏 A magical documentation site generator. | ||||||||||
Wiki | 22,359 | 7 days ago | 50 | August 10, 2023 | 145 | agpl-3.0 | Vue | |||
Wiki.js | A modern and powerful wiki app built on Node.js | ||||||||||
Mdx | 16,080 | 1,354 | 2,680 | 10 days ago | 116 | October 24, 2023 | 11 | mit | JavaScript | |
Markdown for the component era | ||||||||||
Vitepress | 9,519 | 2,098 | 14 hours ago | 197 | November 25, 2023 | 185 | mit | TypeScript | ||
Vite & Vue powered static site generator. | ||||||||||
Vditor | 7,122 | 11 | 51 | 8 days ago | 318 | September 26, 2023 | 83 | mit | TypeScript | |
♏ 一款浏览器端的 Markdown 编辑器,支持所见即所得(富文本)、即时渲染(类似 Typora)和分屏预览模式。An In-browser Markdown editor, support WYSIWYG (Rich Text), Instant Rendering (Typora-like) and Split View modes. | ||||||||||
Mavoneditor | 6,013 | 413 | 161 | 7 months ago | 182 | March 14, 2023 | 336 | mit | Vue | |
mavonEditor - A markdown editor based on Vue that supports a variety of personalized features | ||||||||||
Yn | 5,096 | 6 days ago | 32 | agpl-3.0 | TypeScript | |||||
A highly extensible Markdown editor. Version control, AI completion, mind map, documents encryption, code snippet running, integrated terminal, chart embedding, HTML applets, Reveal.js, plug-in, and macro replacement. |
loader version | webpack version |
---|---|
2.x | 5 |
1.x | 4 and lower |
Webpack loader for converting Markdown files to ALIVE Vue components.
This page (vue-md-loader.wxsm.space) is generated by a markdown file. Source: /example.
There is also a Vue 3 & Vue-cli example: /example-vue3.
NPM:
npm install vue-md-loader --save-dev
Yarn:
yarn add vue-md-loader --dev
Simply use vue-md-loader
to load .md
files and chain it with your vue-loader
.
module.exports = {
// ...
module: {
rules: [
// ...
{
test: /\.md$/,
loader: 'vue-loader!vue-md-loader'
}
]
}
}
Note that to get code highlighting to work, you need to:
highlight.js/styles/github-gist.css
.module.exports = {
// ...
module: {
rules: [
// ...
{
test: /\.md$/,
loaders: [
'vue-loader',
{
loader: 'vue-md-loader',
options: {
// your preferred options
}
}
]
}
]
}
}
A live demo is:
<template>
<div class="cls">{{msg}}</div>
</template>
<script>
export default {
data () {
return {
msg: 'Hello world!'
}
}
}
</script>
<style>
.cls {
color: red;
background: green;
}
</style>
<!-- some-live-demo.vue -->
becomes something like:
<some-live-demo/>
<pre><code>...</code></pre>
A Vue component with all it's <template>
, <script>
and <style>
settled will be inserted before it's source code block.
Multiple lives inside a single markdown file is supported by:
<script>
from different code blocks:
export default
will be extract into it's own Vue component with no conflicts.export default
will be extract into the same top-level component.<style>
from different code blocks will be extract into the same top-level component.Note:
<template>
found in live block.module.exports = {
// ...
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js' // 'vue/dist/vue.common.js' for webpack 1
}
}
}
String. Default: section
The wrapper of entire markdown content, can be HTML tag name or Vue component name.
Object.
Markdown-It options. Default:
{
html: true,
highlight: function (str, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return hljs.highlight(str, { language: lang }).value
} catch (__) {}
}
return ''
}
}
Array.
Markdown-It plugins list. For example:
// ...
plugins: [
// Without option
require('markdown-it-plugin-1'),
// With options
[
require('markdown-it-plugin-2'),
{
// ...
}
]
]
// ...
Object.
Markdown-It renderer rules. For example:
rules: {
'table_open': () => '<div class="table-responsive"><table class="table">',
'table_close': () => '</table></div>'
}
Function. For example:
preProcess: function(source) {
// do anything
return source
}
Function. For example:
// This is useful when used with front-matter-loader to set the page title in nuxt projects
process: function(source){
let attrs = (source && source.attributes) || {}
attrs.title = attrs.title || ""
return {
template: source.body,
style: "",
script: `export default {
head(){
return {
title: '${attrs.title}'
}
}
}`
}
}
Function. For example:
afterProcess: function(result) {
// do anything
return result
}
Boolean. Default: true
Enable / Disable live detecting and assembling.
Regex. Default: /<!--[\s]*?([-\w]+?).vue[\s]*?-->/i
A code block with livePattern
inside itself becomes a live block. The matched body will become the live Vue component's name and reference (note that they must be unique to each other within the same page).
Function. Default: null
Use this if you wish to change the live template manually after process (e.g. add wrappers). For example:
afterProcessLiveTemplate: function(template) {
return `<div class="live-wrapper">${template}</div>`
}
# install dependencies
npm install
# serve example with hot reload at localhost:8888
npm run dev
# run all tests
npm test
MIT