docs: improve docs

This commit is contained in:
pengzhanbo 2026-02-14 18:14:19 +08:00
parent f173d069bd
commit 5930c60462
9 changed files with 116 additions and 12 deletions

View File

@ -115,6 +115,109 @@ passwordHint: The password is 123456
Click to visit [Encrypted Article, Password: 123456](/article/enx7c9s/)
## Partial Content Encryption
### Configuration
Partial content encryption is implemented through the `::: encrypt` container. You need to configure the `markdown.encrypt` option:
```ts title=".vuepress/config.ts"
export default defineUserConfig({
theme: plumeTheme({
markdown: {
encrypt: true, // [!code ++]
}
})
})
```
You can also set a unified default password for the `::: encrypt` container:
```ts title=".vuepress/config.ts"
export default defineUserConfig({
theme: plumeTheme({
markdown: {
encrypt: {
password: 123456, // [!code ++]
}
}
})
})
```
### Usage
Use the `::: encrypt` container to wrap the content that needs to be encrypted.
You can add `password` / `pwd` attribute to the container to set the password for that container.
If no password is set, the default password will be used.
You can also add a `hint` attribute to set a password hint.
```md /password="123456"/
::: encrypt password="123456" hint="The password is 6 consecutive digits"
This is encrypted content
:::
```
::: info Only one password is effective; multiple passwords are not supported simultaneously.
:::
### Example
**Input:**
```md
::: encrypt password="123456"
This is encrypted content
:::
```
**Output:**
::: encrypt password="123456"
This is encrypted content
:::
**Input:**
```md
::: encrypt password="654321" hint="The password is 6 consecutive digits"
This is encrypted content 2
:::
```
**Output:**
::: encrypt password="654321" hint="The password is 6 consecutive digits"
This is encrypted content 2
:::
::: warning Usage Limitations
**For encrypted content, you can use:**
- All standard markdown syntax
- Most extended syntax provided by the theme, except:
- `@[demo]()` code examples imported from directories
- `@[code]()` code snippets imported from directories
- `@[code-tree]()` code trees imported from directories
- Global Vue components provided by the theme
- User-defined global Vue components
- Encrypted content cannot contain executable scripts; for special interactions, please implement through components.
**Network Environment Requirements:**
Partial content encryption is implemented using [Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Crypto),
therefore, it will not work properly in **non-HTTPS environments**.
:::
::: details If you are a technical developer, you may need to know
The original markdown content is first rendered into HTML content, then encrypted; transmitted to the client, then decrypted and rendered.
The decrypted content is wrapped as a dynamic Vue component, with HTML passed as the template to the dynamic component.
This involves runtime template compilation. As a result, if partial content encryption is enabled,
Vue needs to be switched to the `esm-bundler` version to support runtime compilation,
which has slightly worse performance and larger size compared to the default `runtime-only` version.
:::
## Related Configurations
The following configurations can be used in [multilingual settings](../../config/locales.md).

View File

@ -2,7 +2,7 @@
title: LLMs txt
icon: ri:ai
createTime: 2025/12/01 10:46:46
permalink: /en/features/llmstxt/
permalink: /en/guide/features/llmstxt/
---
## Overview

View File

@ -96,5 +96,5 @@ This is the card content.
::::
::: info
If you prefer using cards via components, you can check out the [Card Component](/guide/features/component/#card).
If you prefer using cards via components, you can check out the [Card Component](../features/component.md#card).
:::

View File

@ -36,7 +36,7 @@ Bad news: I've used you as the example \[doge\]
## Overview
In Markdown, wrapping specially formatted text content within a `:: chat` container allows you to display ==chat records== within the documentation.
In Markdown, wrapping specially formatted text content within a `::: chat` container allows you to display ==chat records== within the documentation.
::: warning This is a feature you likely won't need most of the time.
Please consider carefully whether you should use it when the need arises.

View File

@ -1,5 +1,5 @@
---
title: container
title: Tip Containers
icon: mdi:message-text-outline
createTime: 2025/11/29 14:53:21
permalink: /en/guide/markdown/container/

View File

@ -12,9 +12,9 @@ import { people, nature, foods, places, activities, symbols, objects, flags } fr
## Quick Start
在 Markdown 中使用表情符号非常简单,只需用冒号包裹表情代码即可:
Using emoji in Markdown is very simple, just wrap the emoji code with colons:
**Input**
**Input:**
```md
:tada: :100:

View File

@ -1,6 +1,7 @@
---
title: github-alerts
createTime: 2025/11/29 21:20:21
title: GitHub Alerts
icon: mdi:alert-outline
createTime: 2025/11/29 19:59:45
permalink: /en/guide/markdown/github-alerts/
---

View File

@ -2,7 +2,7 @@
title: Icons
createTime: 2025/10/08 14:49:39
icon: grommet-icons:emoji
permalink: /en/guide/markdown/icon/
permalink: /en/guide/markdown/icons/
---
<script setup>

View File

@ -1,9 +1,9 @@
---
title: qrcode
title: QR Code
icon: uiw:qrcode
createTime: 2025/12/05 16:16:06
createTime: 2025/12/05 10:37:43
permalink: /en/guide/markdown/qrcode/
badge:
badge: New
---
@[qrcode](https://github.com/pengzhanbo/vuepress-theme-plume)