-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Neko Ayaka <neko@ayaka.moe>
- Loading branch information
1 parent
e690e14
commit 89f5a92
Showing
6 changed files
with
179 additions
and
12 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
91 changes: 87 additions & 4 deletions
91
docs/pages/en/integrations/vitepress-plugin-enhanced-mark/index.md
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 |
---|---|---|
@@ -1,7 +1,90 @@ | ||
# Enhanced `<mark>` <mark>elements</mark> <Badge type="warning" text="Beta" /> | ||
# Enhanced `<mark>` <mark>elements</mark> <Badge type="tip" text="v1.28.0" /> | ||
|
||
As an interesting little plugin, it adds a <mark>sliding animation</mark> to your `<mark>` highlighted elements. | ||
|
||
## Features | ||
|
||
<div grid="~ cols-[auto_1fr] gap-1" items-center my-1> | ||
<span i-icon-park-outline:check-one text="green-600" /> | ||
<span>No JavaScripts</span> | ||
<span i-icon-park-outline:check-one text="green-600" /> | ||
<span>Stunning looking <mark>animations</mark></span> | ||
<span i-icon-park-outline:check-one text="green-600" /> | ||
<span>Multi-line supports</span> | ||
<span i-icon-park-outline:check-one text="green-600" /> | ||
<span>Day / Night theme (Dark mode) supported</span> | ||
<span i-icon-park-outline:check-one text="green-600" /> | ||
<span>Natively compatible with VitePress design</span> | ||
</div> | ||
|
||
::: info 🤔 Performance drop? No! | ||
|
||
This plugin doesn't contain any JavaScript code, only one stylesheet is provided. | ||
|
||
Therefore, it should be theoretically performant, and won't cause any page lag. | ||
|
||
::: warning 🚧 Constructing | ||
Nice to meet you! But sorry, this page is still under construction. If you don’t find the information you are interested in, you can first find the content you are interested in in the navigation in the sidebar to start reading. | ||
::: | ||
|
||
This is a paragraph that contains <mark>highlighted text with a animated yellow background</mark>. | ||
## Take a look | ||
|
||
It works like this: | ||
|
||
Lorem ipsum dolor sit amet, <mark>consectetur adipiscing elit. Phasellus imperdiet augue ac est iaculis, sed laoreet leo sodales.</mark> Curabitur varius elit sed semper vehicula. Fusce luctus velit vel lacinia sagittis. Nullam sed nisl dictum augue accumsan placerat accumsan sed libero. Morbi aliquam felis id sem sollicitudin, <mark>sit amet convallis velit fermentum. Ut hendrerit leo sodales, placerat nibh ac, consequat purus.</mark> Integer turpis dui, viverra id nunc vestibulum, condimentum ultrices arcu. | ||
|
||
Or in blockquotes: | ||
|
||
> Lorem ipsum dolor sit amet, <mark>consectetur adipiscing elit. Phasellus imperdiet augue ac est iaculis, sed laoreet leo sodales.</mark> Curabitur varius elit sed semper vehicula. Fusce luctus velit vel lacinia sagittis. Nullam sed nisl dictum augue accumsan placerat accumsan sed libero. Morbi aliquam felis id sem sollicitudin, <mark>sit amet convallis velit fermentum. Ut hendrerit leo sodales, placerat nibh ac, consequat purus.</mark> Integer turpis dui, viverra id nunc vestibulum, condimentum ultrices arcu. | ||
## Installation | ||
|
||
Install `@nolebase/vitepress-plugin-enhanced-mark` to your project dependencies by running the following command: | ||
|
||
::: code-group | ||
|
||
```shell [@antfu/ni] | ||
ni @nolebase/vitepress-plugin-enhanced-mark -D | ||
``` | ||
|
||
```shell [pnpm] | ||
pnpm add @nolebase/vitepress-plugin-enhanced-mark -D | ||
``` | ||
|
||
```shell [npm] | ||
npm install @nolebase/vitepress-plugin-enhanced-mark -D | ||
``` | ||
|
||
```shell [yarn] | ||
yarn add @nolebase/vitepress-plugin-enhanced-mark -D | ||
``` | ||
|
||
::: | ||
|
||
## Configuration | ||
|
||
In VitePress's [**theme configuration file**](https://vitepress.dev/reference/default-theme-config#default-theme-config) (note that it's not a **configuration file**, it's usually located at `docs/.vitepress/theme/index.ts`, file paths and extensions may be vary), **import the enhanced mark style**: | ||
|
||
<!--@include: @/pages/en/snippets/details-colored-diff.md--> | ||
|
||
::: code-group | ||
|
||
```typescript twoslash [.vitepress/theme/index.ts] | ||
import { h } from 'vue' | ||
import DefaultTheme from 'vitepress/theme' | ||
import type { Theme as ThemeConfig } from 'vitepress' | ||
|
||
import '@nolebase/vitepress-plugin-enhanced-mark/client/style.css' // [!code ++] | ||
export const Theme: ThemeConfig = { | ||
extends: DefaultTheme, | ||
Layout: () => { | ||
// other configurations... | ||
}, | ||
enhanceApp({ app }) { | ||
// other configurations... | ||
}, | ||
} | ||
|
||
export default Theme | ||
``` | ||
|
||
::: |
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
92 changes: 88 additions & 4 deletions
92
docs/pages/zh-CN/integrations/vitepress-plugin-enhanced-mark/index.md
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 |
---|---|---|
@@ -1,7 +1,91 @@ | ||
# `<mark>` <mark>元素增强</mark> <Badge type="warning" text="Beta 测试" /> | ||
# `<mark>` <mark>元素增强</mark> <Badge type="tip" text="v1.28.0" /> | ||
|
||
这是一个很有意思的小插件,为你的 `<mark>` 高亮元素添加<mark>展开划过</mark>的小动画。 | ||
|
||
## 功能 | ||
|
||
<div grid="~ cols-[auto_1fr] gap-1" items-center my-1> | ||
<span i-icon-park-outline:check-one text="green-600" /> | ||
<span>无 JavaScripts</span> | ||
<span i-icon-park-outline:check-one text="green-600" /> | ||
<span>炒鸡好看的<mark>动画</mark></span> | ||
<span i-icon-park-outline:check-one text="green-600" /> | ||
<span>多行文本也支持</span> | ||
<span i-icon-park-outline:check-one text="green-600" /> | ||
<span>亮/暗色主题(暗色模式)适配</span> | ||
<span i-icon-park-outline:check-one text="green-600" /> | ||
<span>原生与 VitePress 样式兼容</span> | ||
</div> | ||
|
||
::: info 🤔 Performance drop? No! | ||
|
||
This plugin doesn't contain any JavaScript code, only one stylesheet is provided. | ||
|
||
Therefore, it should be theoretically performant, and won't cause any page lag. | ||
|
||
::: | ||
|
||
## 一览效果 | ||
|
||
它看起来将会是这样的: | ||
|
||
廷流李迅韦躁您挂吉蠕腐<mark>峰嗽码啥嚼胃欠缸儒勿却次城贫能称棱乌吴猪糟撕扩寒级虾亦。</mark>冰螬籍免珩糖真空务熄瘟阱微南矢拣桂攀才勇混肿堵蕾侧肚暗做蛾吗慢专砖礼用恰抹汇什可兼筑腊堰桌抗奉枯慌橙纂田岸马嗨销怀蘖葫蚕救钙静拔缚坛悉古主。<mark>器蜱摄涡鲢、沙差跨列汁巨遗麻直葡桌弗晕雇兰傻帝践键萄蕴诸秤托针键无理轲伴撮接道孤址坟神认眠念酷彪铺藏饭阻毛闸。腕钴填靳凝迎荸浑水界染防黑畔、臂炕传绞夏蕨党运器蓟阻外妙蹲悉橙。</mark>绘饵定音! | ||
|
||
或者在引用块中: | ||
|
||
> 廷流李迅韦躁您挂吉蠕腐<mark>峰嗽码啥嚼胃欠缸儒勿却次城贫能称棱乌吴猪糟撕扩寒级虾亦。</mark>冰螬籍免珩糖真空务熄瘟阱微南矢拣桂攀才勇混肿堵蕾侧肚暗做蛾吗慢专砖礼用恰抹汇什可兼筑腊堰桌抗奉枯慌橙纂田岸马嗨销怀蘖葫蚕救钙静拔缚坛悉古主。<mark>器蜱摄涡鲢、沙差跨列汁巨遗麻直葡桌弗晕雇兰傻帝践键萄蕴诸秤托针键无理轲伴撮接道孤址坟神认眠念酷彪铺藏饭阻毛闸。腕钴填靳凝迎荸浑水界染防黑畔、臂炕传绞夏蕨党运器蓟阻外妙蹲悉橙。</mark>绘饵定音! | ||
## 安装 | ||
|
||
通过运行以下命令将 `@nolebase/vitepress-plugin-enhanced-mark` 安装到您的项目依赖项中: | ||
|
||
::: code-group | ||
|
||
```shell [@antfu/ni] | ||
ni @nolebase/vitepress-plugin-enhanced-mark -D | ||
``` | ||
|
||
```shell [pnpm] | ||
pnpm add @nolebase/vitepress-plugin-enhanced-mark -D | ||
``` | ||
|
||
```shell [npm] | ||
npm install @nolebase/vitepress-plugin-enhanced-mark -D | ||
``` | ||
|
||
```shell [yarn] | ||
yarn add @nolebase/vitepress-plugin-enhanced-mark -D | ||
``` | ||
|
||
::: | ||
|
||
## 配置 | ||
|
||
在 VitePress 的[**主题配置文件**](https://vitepress.dev/reference/default-theme-config#default-theme-config)中(注意不是**配置文件**,通常为 `docs/.vitepress/theme/index.ts`,文件路径和拓展名也许会有区别),**将 `<mark>` 元素增强插件所提供的样式表更新到 VitePress 主题中**: | ||
|
||
<!--@include: @/pages/zh-CN/snippets/details-colored-diff.md--> | ||
|
||
::: code-group | ||
|
||
```typescript twoslash [.vitepress/theme/index.ts] | ||
import { h } from 'vue' | ||
import DefaultTheme from 'vitepress/theme' | ||
import type { Theme as ThemeConfig } from 'vitepress' | ||
|
||
import '@nolebase/vitepress-plugin-enhanced-mark/client/style.css' // [!code ++] | ||
export const Theme: ThemeConfig = { | ||
extends: DefaultTheme, | ||
Layout: () => { | ||
// 其他配置... | ||
}, | ||
enhanceApp({ app }) { | ||
// 其他配置... | ||
}, | ||
} | ||
|
||
export default Theme | ||
``` | ||
|
||
::: warning 🚧 施工中 | ||
很高兴见到你!但很抱歉,这个页面还在施工中,如果没有找到你感兴趣的信息,你可以先在侧边栏的导航中寻找你感兴趣的内容来开始阅读 | ||
::: | ||
|
||
这是一个包含 <mark>带有动画黄色背景的高亮文本</mark> 的段落。 |