Skip to content

Commit

Permalink
doc format optimize for zh
Browse files Browse the repository at this point in the history
  • Loading branch information
aprosail committed Jun 23, 2024
1 parent bb14fbb commit 08bc328
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import DefaultTheme from "vitepress/theme"
import "./root.css"

export default DefaultTheme
4 changes: 4 additions & 0 deletions docs/.vitepress/theme/root.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
html:lang("zh") div.vp-doc p {
text-indent: 2rem;
text-align: justify;
}
8 changes: 4 additions & 4 deletions docs/zh/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
但 Markdown 在渲染时会默认将换行渲染为空格,
而这样的空格在中文这种不用空格分割词汇的语言中显然是不合适的。

```ts
```ts:line-numbers
import md from "markdown-it"
md.renderer.rules.softbreak = () => ""
md.renderer.rules.softbreak = () => "" // [!code focus]
```

在使用 [markdown-it](https://markdown-it.github.io) 时,
Expand All @@ -22,8 +22,8 @@ md.renderer.rules.softbreak = () => ""
使用这个插件后,使用 Markdown 编辑中文这样的语言时,
就可以随意的换行来而不必担心句子里被添加不美观的空格的问题了。

```ts
```ts:line-numbers
import md from "markdown-it"
import {Options} from "markdown-it-wordless"
md.use(wordless)
md.use(wordless) // [!code focus]
```

0 comments on commit 08bc328

Please sign in to comment.