Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
nnecec committed Sep 6, 2023
2 parents 97b19f1 + ec6a6b0 commit 9ad4da8
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/orange-pianos-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'prettier-plugin-zh': minor
---

support spaceAroundCode, spaceAroundLink
2 changes: 1 addition & 1 deletion apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "^20.5.7",
"@types/node": "^20.5.9",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"autoprefixer": "^10.4.15",
Expand Down
2 changes: 2 additions & 0 deletions apps/website/pages/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
},
"space-around-alphabet": "space-around-alphabet",
"space-around-number": "space-around-number",
"space-around-code": "space-around-code",
"space-around-link": "space-around-link",
"no-space-between-number-unit": "no-space-between-number-unit",
"no-space-around-fullwidth": "no-space-around-fullwidth",
"no-duplicate-punctuation": "no-duplicate-punctuation",
Expand Down
3 changes: 3 additions & 0 deletions apps/website/pages/no-space-between-number-unit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,19 @@ temperature units, etc.
<!-- "noSpaceBetweenNumberUnit": ["%", "°"] -->

<!-- ✅ Correct -->

角度為 90° 的角,就是直角。

新 MacBook Pro 有 15% 的 CPU 性能提升。

<!-- ❌ Incorrect -->

角度為 90 ° 的角,就是直角。

新 MacBook Pro 有 15 % 的 CPU 性能提升。

<!-- 🔧 Fixed -->

角度為 90° 的角,就是直角。

新 MacBook Pro 有 15% 的 CPU 性能提升。
Expand Down
36 changes: 36 additions & 0 deletions apps/website/pages/space-around-code.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# space-around-code

🛠️ This rule require configuration.

🔧 This rule is automatically fixable.

## 📖 Rule Details

Place one space before/after inline code block.

```md
<!-- ✅ Correct -->

今天使用了 `Vite` 来打包应用

<!-- ❌ Incorrect -->

今天使用了`Vite`来打包应用

<!-- 🔧 Fixed -->

今天使用了 `Vite` 来打包应用
```

## ⚙️ Usage

```json
{
"spaceAroundCode": true
}
```

- **Type:** `boolean`
- **Default:** `false`
- **Description:** When set to `true`, this option will enable the insertion of spaces around inline
code block. If set to `false`, this feature will be disabled.
39 changes: 39 additions & 0 deletions apps/website/pages/space-around-link.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# space-around-link

🛠️ This rule require configuration.

🔧 This rule is automatically fixable.

## 📖 Rule Details

Place one space before/after inline link block.

```md
<!-- ✅ Correct -->

查看 Awesome Vite 仓库的 [社区维护模板](https://github.com/vitejs/awesome-vite#templates) ,里面包含
各种工具和不同框架的模板。

<!-- ❌ Incorrect -->

查看 Awesome Vite 仓库的[社区维护模板](https://github.com/vitejs/awesome-vite#templates),里面包含各
种工具和不同框架的模板。

<!-- 🔧 Fixed -->

查看 Awesome Vite 仓库的 [社区维护模板](https://github.com/vitejs/awesome-vite#templates),里面包含
各种工具和不同框架的模板。
```

## ⚙️ Usage

```json
{
"spaceAroundLink": true
}
```

- **Type:** `boolean`
- **Default:** `false`
- **Description:** When set to `true`, this option will enable the insertion of spaces around inline
link block. If set to `false`, this feature will be disabled.
5 changes: 1 addition & 4 deletions apps/website/theme.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ const config: DocsThemeConfig = {
)
},
logo: <Logo size={36} />,
primaryHue: {
dark: 350,
light: 340,
},
primaryHue: 35,
project: {
link: 'https://github.com/nnecec/zh',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ module.exports = {
noDuplicatePunctuation: true,
noSpaceBetweenNumberUnit: defaultUnits,
plugins: ['prettier-plugin-zh'],
spaceAroundLink: true,
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# space-around-block

test space-`around`-code-[baidu](www.baidu.com)点击去百度 baidu
test space-`around`-code- [baidu](www.baidu.com) 点击去百度 baidu

查看 Awesome Vite 仓库的 [社区维护模板](https://github.com/vitejs/awesome-vite#templates),里面包含各种工具和不同框架的模板。

0 comments on commit 9ad4da8

Please sign in to comment.