How do I import a third-party markdown-it extension? #157
Replies: 2 comments 2 replies
-
Seems like you are searching how to extend markdown, Actually, @vuepress/plugin-container should be able to meet your requirements:
|
Beta Was this translation helpful? Give feedback.
-
Actually, you need to understand there are two part here: module.exports = {
extendsMarkdown: (md) => {
md.use(YourMarkdownItPlugin)
},
}
Both of them can be used to extend
First of all, you have to understand two part of // theme/client/ClientAppEnhence.js
import { defineClientAppEnhance } from '@vuepress/client'
export default defineClientAppEnhance(({ app, router, siteData }) => {
// ...
})
// theme/node/index.js
const { path } = require('@vuepress/utils')
module.exports = {
clientAppEnhance: path.resolve(__dirname, '../client/ClientAppEnhence.js'),
} There is a recommend file directory:
|
Beta Was this translation helpful? Give feedback.
-
I would like to use the markdown-it extension, markdown-it-container [https://github.com/markdown-it/markdown-it-container] so that I can create my own custom containers besides the ones you already (:::warning, :::tip).
My use case is to create a container for columns like :::column. So I can build multi column layouts.
I'm not sure how I would go about doing this or getting the custom extension enabled and running within vuepress. Currently when I add a custom container flag :::column it does not generate
<div class="column"></div>
as is stated in the documentation. It instead generates<p>::: column <em>here be dragons</em> :::</p>
Beta Was this translation helpful? Give feedback.
All reactions