From 5930c6046224ee0b95a4f05fb60bf3e6e5b7957f Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Sat, 14 Feb 2026 18:14:19 +0800 Subject: [PATCH] docs: improve docs --- docs/en/guide/features/encryption.md | 103 ++++++++++++++++++++++++ docs/en/guide/features/llmstxt.md | 2 +- docs/en/guide/markdown/card.md | 2 +- docs/en/guide/markdown/chat.md | 2 +- docs/en/guide/markdown/container.md | 2 +- docs/en/guide/markdown/emoji.md | 4 +- docs/en/guide/markdown/github-alerts.md | 5 +- docs/en/guide/markdown/icons.md | 2 +- docs/en/guide/markdown/qrcode.md | 6 +- 9 files changed, 116 insertions(+), 12 deletions(-) diff --git a/docs/en/guide/features/encryption.md b/docs/en/guide/features/encryption.md index 8679699a..d0214d76 100644 --- a/docs/en/guide/features/encryption.md +++ b/docs/en/guide/features/encryption.md @@ -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). diff --git a/docs/en/guide/features/llmstxt.md b/docs/en/guide/features/llmstxt.md index 243c28f0..d9f1236b 100644 --- a/docs/en/guide/features/llmstxt.md +++ b/docs/en/guide/features/llmstxt.md @@ -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 diff --git a/docs/en/guide/markdown/card.md b/docs/en/guide/markdown/card.md index 1f61968e..111a061f 100644 --- a/docs/en/guide/markdown/card.md +++ b/docs/en/guide/markdown/card.md @@ -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). ::: diff --git a/docs/en/guide/markdown/chat.md b/docs/en/guide/markdown/chat.md index f5638e37..24101b38 100644 --- a/docs/en/guide/markdown/chat.md +++ b/docs/en/guide/markdown/chat.md @@ -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. diff --git a/docs/en/guide/markdown/container.md b/docs/en/guide/markdown/container.md index 3a749140..5bba984e 100644 --- a/docs/en/guide/markdown/container.md +++ b/docs/en/guide/markdown/container.md @@ -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/ diff --git a/docs/en/guide/markdown/emoji.md b/docs/en/guide/markdown/emoji.md index 6f3a1464..31eacd26 100644 --- a/docs/en/guide/markdown/emoji.md +++ b/docs/en/guide/markdown/emoji.md @@ -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: diff --git a/docs/en/guide/markdown/github-alerts.md b/docs/en/guide/markdown/github-alerts.md index 8b40aea6..4faffb86 100644 --- a/docs/en/guide/markdown/github-alerts.md +++ b/docs/en/guide/markdown/github-alerts.md @@ -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/ --- diff --git a/docs/en/guide/markdown/icons.md b/docs/en/guide/markdown/icons.md index ca0256fd..aa5c8f72 100644 --- a/docs/en/guide/markdown/icons.md +++ b/docs/en/guide/markdown/icons.md @@ -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/ ---