-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5269931
commit 58f79d6
Showing
37 changed files
with
1,616 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
# markdown-hint | ||
|
||
<NpmBadge package="@vuepress/plugin-markdown-hint" /> | ||
|
||
Add gfm alerts and hint containers to your VuePress site. | ||
|
||
## Usage | ||
|
||
```bash | ||
npm i -D @vuepress/plugin-markdown-hint@next | ||
``` | ||
|
||
```ts | ||
import { markdownHintPlugin } from '@vuepress/plugin-markdown-hint' | ||
|
||
export default { | ||
plugins: [ | ||
markdownHintPlugin({ | ||
// Enable hint container, true by default | ||
hint: true, | ||
// Enable gfm alert | ||
alert: true, | ||
}), | ||
], | ||
} | ||
``` | ||
|
||
## Guide | ||
|
||
By default, we support `important`, `info`, `note`, `tip`, `warning`, `caution`, `details` containers with markdown container: | ||
|
||
::: tip | ||
|
||
A custom tip container with `code`, [link](#demo). | ||
|
||
```js | ||
const a = 1 | ||
``` | ||
|
||
::: | ||
|
||
````md | ||
::: tip | ||
|
||
A custom tip container with `code`, [link](#demo). | ||
|
||
```js | ||
const a = 1 | ||
``` | ||
|
||
::: | ||
```` | ||
|
||
To customize the title of the container, you can add the title after the named container: | ||
|
||
::: important Custom Title | ||
|
||
A important container with customized title. | ||
|
||
::: | ||
|
||
```md | ||
::: important Custom Title | ||
|
||
A important container with customized title. | ||
|
||
::: | ||
``` | ||
|
||
The container can contain a title only: | ||
|
||
::: warning A warning text | ||
::: | ||
|
||
```md | ||
::: warning A warning text | ||
::: | ||
``` | ||
|
||
The plugin also provides an `alert` option to support gfm alerts: | ||
|
||
```md | ||
> [!note] | ||
> This is note text | ||
|
||
> [!important] | ||
> This is important text | ||
|
||
> [!tip] | ||
> This is tip text | ||
|
||
> [!warning] | ||
> This is warning text | ||
|
||
> [!caution] | ||
> This is caution text | ||
``` | ||
|
||
## Options | ||
|
||
### hint | ||
|
||
- Type: `boolean` | ||
- Details: Whether enable hint containers, enabled by default. | ||
|
||
### alert | ||
|
||
- Type: `boolean` | ||
- Details: Whether enable gfm alert support. | ||
|
||
### locales | ||
|
||
- Type: `MarkdownHintPluginLocaleOptions` | ||
|
||
```ts | ||
interface MarkdownHintPluginLocaleOptions { | ||
[localePath: string]: MarkdownHintPluginLocaleData | ||
} | ||
|
||
interface MarkdownHintPluginLocaleData { | ||
/** | ||
* Default Title text for important block | ||
*/ | ||
important: string | ||
|
||
/** | ||
* Default Title text for note block | ||
*/ | ||
note: string | ||
|
||
/** | ||
* Default Title text for tip block | ||
*/ | ||
tip: string | ||
|
||
/** | ||
* Default Title text for warning block | ||
*/ | ||
warning: string | ||
|
||
/** | ||
* Default Title text for danger block | ||
*/ | ||
caution: string | ||
|
||
/** | ||
* Default Title text for info block | ||
*/ | ||
info: string | ||
|
||
/** | ||
* Default Title text for details block | ||
*/ | ||
details: string | ||
} | ||
``` | ||
|
||
- Details: The locales for hint container titles. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.