Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions docs/plugins/markdown/markdown-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ document.querySelector('body').innerText = 'Hello world!'
}
```

- Details:

Locales configuration for `<VPPreview>`.
- Details: Locales configuration for `<VPPreview>`.

## Styles

Expand Down
12 changes: 6 additions & 6 deletions docs/zh/plugins/markdown/markdown-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default {
````md
<VPPreview title="可选标题">
<template #content>
<!-- 你的内容在这里 -->
<!-- 你的内容在这里 -->

Hello world!

Expand All @@ -67,7 +67,7 @@ document.querySelector('body').innerText = 'Hello world!'

<VPPreview title="可选标题">
<template #content>
<!-- 你的内容在这里 -->
<!-- 你的内容在这里 -->

Hello world!

Expand All @@ -91,15 +91,15 @@ document.querySelector('body').innerText = 'Hello world!'
```ts
export interface MarkdownPreviewLocaleData {
/**
* 切换代码按钮文本
* Toggle code button text
*
* 切换代码按钮文字
*/
toggle: string
}
```

- 详细信息:

`<VPPreview>` 的多语言配置。
- 详情:`<VPPreview>` 的本地化配置。

## 样式

Expand Down
1 change: 1 addition & 0 deletions plugins/markdown/plugin-markdown-preview/src/node/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './markdownPreviewPlugin.js'
export type * from './options.js'
export * from './preview.js'
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ const PLUGIN_NAME = '@vuepress/plugin-markdown-preview'

const __dirname = getDirname(import.meta.url)

/**
* Markdown preview plugin
*
* Markdown 预览插件
*
* @param options - plugin options / 插件选项
*
* @example
* ```ts
* import { markdownPreviewPlugin } from '@vuepress/plugin-markdown-preview'
*
* export default {
* plugins: [
* markdownPreviewPlugin(),
* ],
* }
* ```
*/
export const markdownPreviewPlugin =
(options: MarkdownPreviewPluginOptions = {}): Plugin =>
(app) => ({
Expand Down
4 changes: 2 additions & 2 deletions plugins/markdown/plugin-markdown-preview/src/node/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import type { MarkdownPreviewPluginLocaleData } from '../shared/index.js'

export interface MarkdownPreviewPluginOptions {
/**
* Localization config
* Localization config for preview component
*
* 本地化配置
* 预览组件的本地化配置
*/
locales?: LocaleConfig<MarkdownPreviewPluginLocaleData>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import type { ExactLocaleConfig } from '@vuepress/helper'

export interface MarkdownPreviewPluginLocaleData {
/**
* toggle code button text
* Toggle code button text
*
* 切换代码按钮文字
*/
toggle: string
}
Expand Down
Loading