-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
f5e79e9
commit 45fdfcb
Showing
15 changed files
with
647 additions
and
1 deletion.
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,87 @@ | ||
--- | ||
title: "@mdit/plugin-abbr" | ||
icon: book | ||
--- | ||
|
||
Plugin to support abbreviation tag `<abbr>`. | ||
|
||
<!-- more --> | ||
|
||
## Usage | ||
|
||
::: code-tabs#language | ||
|
||
@tab TS | ||
|
||
```ts | ||
import MarkdownIt from "markdown-it"; | ||
import { abbr } from "@mdit/plugin-abbr"; | ||
|
||
const mdIt = MarkdownIt().use(abbr); | ||
|
||
mdIt.render(` | ||
*[HTML]: Hyper Text Markup Language | ||
*[W3C]: World Wide Web Consortium | ||
The HTML specification is maintained by the W3C. | ||
`); | ||
``` | ||
|
||
@tab JS | ||
|
||
```js | ||
const MarkdownIt = require("markdown-it"); | ||
const { abbr } = require("@mdit/plugin-abbr"); | ||
|
||
const mdIt = MarkdownIt().use(abbr); | ||
|
||
mdIt.render(` | ||
*[HTML]: Hyper Text Markup Language | ||
*[W3C]: World Wide Web Consortium | ||
The HTML specification is maintained by the W3C. | ||
`); | ||
``` | ||
|
||
::: | ||
|
||
<!-- markdownlint-disable MD028 --> | ||
|
||
## Syntax | ||
|
||
With this plugin you can declare abbreviations using reference beginning with an extra `*`: | ||
|
||
<!-- prettier-ignore-start --> | ||
|
||
```md | ||
*[Abbr word]: Abbr content | ||
``` | ||
|
||
<!-- prettier-ignore-end --> | ||
|
||
::: tip Escaping | ||
|
||
Escaping can be done by adding `\` to escape the `*` `[` or `]` marker: | ||
|
||
```md | ||
\*[text]: content | ||
``` | ||
|
||
will be | ||
|
||
\*[text]: content | ||
|
||
::: | ||
|
||
## Demo | ||
|
||
<!-- prettier-ignore-start --> | ||
|
||
::: md-demo Demo | ||
|
||
*[HTML]: Hyper Text Markup Language | ||
*[W3C]: World Wide Web Consortium | ||
|
||
The HTML specificationis maintained by the W3C. | ||
|
||
::: | ||
|
||
<!-- prettier-ignore-end --> |
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,87 @@ | ||
--- | ||
title: "@mdit/plugin-abbr" | ||
icon: book | ||
--- | ||
|
||
支持缩写词 `<abbr>` 标签的插件。 | ||
|
||
<!-- more --> | ||
|
||
## Usage | ||
|
||
::: code-tabs#language | ||
|
||
@tab TS | ||
|
||
```ts | ||
import MarkdownIt from "markdown-it"; | ||
import { abbr } from "@mdit/plugin-abbr"; | ||
|
||
const mdIt = MarkdownIt().use(abbr); | ||
|
||
mdIt.render(` | ||
*[HTML]: Hyper Text Markup Language | ||
*[W3C]: World Wide Web Consortium | ||
The HTML specification is maintained by the W3C. | ||
`); | ||
``` | ||
|
||
@tab JS | ||
|
||
```js | ||
const MarkdownIt = require("markdown-it"); | ||
const { abbr } = require("@mdit/plugin-abbr"); | ||
|
||
const mdIt = MarkdownIt().use(abbr); | ||
|
||
mdIt.render(` | ||
*[HTML]: Hyper Text Markup Language | ||
*[W3C]: World Wide Web Consortium | ||
The HTML specification is maintained by the W3C. | ||
`); | ||
``` | ||
|
||
::: | ||
|
||
<!-- markdownlint-disable MD028 --> | ||
|
||
## 语法 | ||
|
||
通过此插件,你可以通过以额外 `*` 开头的链接声明来声明缩略词。 | ||
|
||
<!-- prettier-ignore-start --> | ||
|
||
```md | ||
*[缩略词]: 内容 | ||
``` | ||
|
||
<!-- prettier-ignore-end --> | ||
|
||
::: tip 转移 | ||
|
||
转义可以通过添加额外的 `\` 以转义 `*` `[` 或 `]` 字符: | ||
|
||
```md | ||
\*[文字]: 内容 | ||
``` | ||
|
||
will be | ||
|
||
\*[文字]: 内容 | ||
|
||
::: | ||
|
||
## 示例 | ||
|
||
<!-- prettier-ignore-start --> | ||
|
||
::: md-demo 示例 | ||
|
||
*[HTML]: Hyper Text Markup Language | ||
*[W3C]: World Wide Web Consortium | ||
|
||
The HTML specificationis maintained by the W3C. | ||
|
||
::: | ||
|
||
<!-- prettier-ignore-end --> |
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,22 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2014-2015 Vitaly Puzrin, Alex Kocharin. | ||
Copyright (C) 2024 - PRESENT by MrHope | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
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,16 @@ | ||
# @mdit/plugin-abbr | ||
|
||
[![Version](https://img.shields.io/npm/v/@mdit/plugin-abbr.svg?style=flat-square&logo=npm) ![Downloads](https://img.shields.io/npm/dm/@mdit/plugin-abbr.svg?style=flat-square&logo=npm) ![Size](https://img.shields.io/bundlephobia/min/@mdit/plugin-abbr?style=flat-square&logo=npm)](https://www.npmjs.com/package/@mdit/plugin-abbr) | ||
|
||
abbr plugin for MarkdownIt. | ||
|
||
## Install / 安装 | ||
|
||
```bash | ||
# pnpm | ||
pnpm add -D @mdit/plugin-abbr | ||
# npm | ||
npm i -D @mdit/plugin-abbr | ||
# yarn | ||
yarn add -D @mdit/plugin-abbr | ||
``` |
Oops, something went wrong.