element-plus/website/md-loader/config.js
zazzaz f12000f9c2
feat: add website (#135)
* feat: add website

* chore: fix
2020-08-13 15:18:26 +08:00

28 lines
630 B
JavaScript

/* eslint-disable @typescript-eslint/no-var-requires */
const Config = require('markdown-it-chain')
const anchorPlugin = require('markdown-it-anchor')
const slugify = require('transliteration').slugify
const containers = require('./containers')
const overWriteFenceRule = require('./fence')
const config = new Config()
config
.options.html(true).end()
.plugin('anchor').use(anchorPlugin, [
{
level: 2,
slugify: slugify,
permalink: true,
permalinkBefore: true,
},
]).end()
.plugin('containers').use(containers).end()
const md = config.toMd()
overWriteFenceRule(md)
module.exports = md