docs: update example

This commit is contained in:
pengzhanbo 2023-12-25 03:51:17 +08:00
parent 0d329f7f4a
commit 37d0bac7c9
7 changed files with 210 additions and 5 deletions

View File

@ -82,6 +82,7 @@ export default defineUserConfig({
copyright: 'Copyright © 2022-present pengzhanbo',
},
themePlugins: {
markdownEnhance: { katex: true },
search: {
locales: {
'/': {

View File

@ -92,7 +92,7 @@ HTTP缓存根据是否需要重新向服务器发起请求可分为两大
``` html
<meta http-equiv="Pragma" content="no-cache">
```
::: danger 警告
::: caution 警告
- 这个标签声明仅有 IE才能识别含义其他主流浏览器不兼容。
- 在IE浏览器中虽然能够识别含义但并不一定会在请求Request Header中加上Pragma但确实会让当前页面每次都发起新请求。
仅限页面html文件页面内使用的其他资源不受影响。
@ -120,7 +120,7 @@ Expires 的值是一个 GMT时间 如:`Thu Jun 07 2018 14:26:45 GMT`,用
```
如果希望不走缓存,每次页面请求都发起新的请求,可以把 content 设置为 -1 或 0。
::: danger 提醒
::: caution 提醒
跟 Pragma 字段一样, 该 meta 标签只有 IE 能够正确识别。
而且该方式仅是告知 IE 缓存时间的标记,并不能在 Request Header 中找到该字段。
:::

View File

@ -35,7 +35,7 @@ npm install
警告
:::
::: danger
::: caution
危险
:::

View File

@ -0,0 +1,193 @@
---
title: 主题效果预览
author: Plume Theme
createTime: 2023/12/25 01:28:29
permalink: /article/0lk24ty5/
sticky: true
tags:
- 预览
- 标签
---
# 标题H1
## 标题H2
### 标题H3
#### 标题H4
##### 标题H5
###### 标题H6
## 标题2 Badge <Badge type="tip" text="Badge" />
### 标题3 Badge <Badge type="warning" text="Badge" />
#### 标题4 Badge <Badge type="danger" text="Badge" />
正文内容。
`@property` CSS at-rule是 [CSS Houdini API](https://developer.mozilla.org/zh-CN/docs/Web/Guide/Houdini) 的一部分,它允许开发者显式地定义他们的 [CSS 自定义属性](https://developer.mozilla.org/zh-CN/docs/Web/CSS/--*), 允许进行属性类型检查、设定默认值以及定义该自定义属性是否可以被继承。
`@property` 的出现,极大的增强了 CSS 的能力。
**加粗文字**
_斜体文字_
~~删除文字~~
内容 ==标记==
数学表达式: $-(2^{n-1})$ ~ $2^{n-1} -1$
::: center
内容居中
:::
::: right
内容右对齐
:::
- 无序列表1
- 无序列表2
- 无序列表3
1. 有序列表1
2. 有序列表2
3. 有序列表3
| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
> 引用内容
>
> 引用内容
[链接](/)
[外部链接](https://github.com/pengzhanbo)
![image](/images/1px-lines.png)
**Badge**
- <Badge type="info" text="info badge" />
- <Badge type="tip" text="tip badge" />
- <Badge type="warning" text="warning badge" />
- <Badge type="danger" text="danger badge" />
**图标**
- home - <Iconify name="material-symbols:home" color="currentColor" size="1em" />
- vscode - <Iconify name="skill-icons:vscode-dark" size="2em" />
- twitter - <Iconify name="skill-icons:twitter" size="2em" />
**代码**
```js
const a = 1
const b = 2
const c = a + b
```
**代码分组**
::: code-tabs
@tab tab1
```js
const a = 1
const b = 2
const c = a + b
```
@tab tab2
```ts
const a: number = 1
const b: number = 2
const c: number = a + b
```
:::
**代码块高亮**
```ts
function foo() {
const a = 1 // [!code highlight]
console.log(a)
const b = 2 // [!code ++]
const c = 3 // [!code --]
console.log(a + b + c) // [!code error]
console.log(a + b) // [!code warning]
}
```
**代码块聚焦**
```ts
function foo() {
const a = 1 // [!code focus]
}
```
::: info 注释
注释内容
:::
::: tip 提示
提示内容
:::
::: warning 警告
警告内容
:::
::: caution 错误
错误内容
:::
::: important 重要
重要内容
:::
::: info
代码
```ts
const a = 1
const b = 2
```
:::
**代码演示**
::: normal-demo Demo 演示
```html
<h1>Hello Word!</h1>
<p><span id="very">非常</span>强大!</p>
```
```js
document.querySelector("#very").addEventListener("click", () => {
alert("非常强大");
});
```
```css
span {
color: red;
}
```
:::

View File

@ -60,11 +60,11 @@ markdown 增强 由 [vuepress-plugin-md-enhance](https://vuepress-theme-hope.git
- 危险
``` md
::: danger 危险
::: caution 危险
危险内容
:::
```
::: danger 危险
::: caution 危险
危险内容
`markdown`
:::

View File

@ -15,6 +15,7 @@
"@vuepress/client": "2.0.0-rc.0",
"@vuepress/utils": "2.0.0-rc.0",
"anywhere": "^1.6.0",
"katex": "^0.16.9",
"leancloud-storage": "^4.15.2",
"sass": "^1.69.5",
"sass-loader": "^13.3.2",

10
pnpm-lock.yaml generated
View File

@ -122,6 +122,9 @@ importers:
anywhere:
specifier: ^1.6.0
version: 1.6.0
katex:
specifier: ^0.16.9
version: 0.16.9
leancloud-storage:
specifier: ^4.15.2
version: 4.15.2
@ -11008,6 +11011,13 @@ packages:
resolution: {integrity: sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==}
dev: false
/katex@0.16.9:
resolution: {integrity: sha512-fsSYjWS0EEOwvy81j3vRA8TEAhQhKiqO+FQaKWp0m39qwOzHVBgAUBIXWj1pB+O2W3fIpNa6Y9KSKCVbfPhyAQ==}
hasBin: true
dependencies:
commander: 8.3.0
dev: false
/keep-func-props@4.0.1:
resolution: {integrity: sha512-87ftOIICfdww3SxR5P1veq3ThBNyRPG0JGL//oaR08v0k2yTicEIHd7s0GqSJfQvlb+ybC3GiDepOweo0LDhvw==}
engines: {node: '>=12.20.0'}