-
Hello. Currently, adding a new Vue component into a theme is easy. In addition to that, I'd like to know if it is possible to add a The container code is helpful, but I don't understand how the I'd like to use said component for source code blocks, separated by the version, so writing a component name in Markdown each time would be inconvenient. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
What kind of syntax do you want, can you show us an example. Is it something like this: ::: foo bar
baz
::: or simply If it's first one, then you can have a look at this example: #313 (comment) or https://github.com/markdown-it/markdown-it-container#example or https://github.com/vuejs/vitepress/blob/main/src/node/markdown/plugins/containers.ts. If it's second one, then you can simply do: md.use(container, 'foo', {
render: (tokens: Token[], idx: number) =>
tokens[idx].nesting === 1 ? `<div class="foo">\n` : `</div>\n`
}) |
Beta Was this translation helpful? Give feedback.
What kind of syntax do you want, can you show us an example. Is it something like this:
or simply
::: foo
without any props?If it's first one, then you can have a look at this example: #313 (comment) or https://github.com/markdown-it/markdown-it-container#example or https://github.com/vuejs/vitepress/blob/main/src/node/markdown/plugins/containers.ts.
If it's second one, then you can simply do: