Skip to content

Commit

Permalink
docs(cli, ui): fix docs typo
Browse files Browse the repository at this point in the history
affects: @varlet/cli, @varlet/ui
  • Loading branch information
haoziqaq committed Nov 20, 2021
1 parent 3bfdedc commit c51625b
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 4 deletions.
30 changes: 28 additions & 2 deletions packages/varlet-cli/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,32 @@ The `varlet.config.js` in the project root directory is used to manage the speci
| `analysis` | Document statistics related | _SiteAnalysis_ | `-` |
| `pc` | PC-side document structure configuration | _SitePC_ | `-` |
| `mobile` | Mobile document structure configuration | _SiteMobile_ | `-` |
| `moduleCompatible` | Module compatible config | _Record<string, string>_ | `-` |

#### Module Compatible

Some external dependencies may need to be compatible with module syntax to achieve the purpose of compiling correctly to `commonjs` and `esmodule`. For example, the wording of `esmodule` of `dayjs` is

```js
import dayjs from 'dayjs/esm'
```

In order to build `commonjs`, the writing method is

```js
import * as dayjs from 'dayjs'
```

In the project, we embrace the first way of writing the `esmodule` module, and make the following configuration for adaptation

```js
// varlet.config.js
module.exports = {
moduleCompatible: {
"import dayjs from 'dayjs/esm'\n": "import * as dayjs from 'dayjs'\n"
}
}
```

#### SiteThemes

Expand Down Expand Up @@ -93,15 +119,15 @@ Code snippets are highlighted, based on [highlight.js](https://highlightjs.org/)

| Parameter | Description | Type | Default |
| ----- | -------------- | -------- | ---------- |
| `style` | highlight的css地址 | _string_ | `-` |
| `style` | highlight css link | _string_ | `-` |

#### SiteAnalysis

Statistics related to buried points

| Parameter | Description | Type | Default |
| ----- | -------------- | -------- | ---------- |
| `baidu` | 百度统计脚本地址 | _string_ | `-` |
| `baidu` | Baidu statistics script address | _string_ | `-` |

#### SitePC, SiteMobile

Expand Down
26 changes: 26 additions & 0 deletions packages/varlet-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,32 @@ yarn dev
| `analysis` | 文档统计相关 | _SiteAnalysis_ | `-` |
| `pc` | pc端文档结构配置 | _SitePC_ | `-` |
| `mobile` | mobile端文档结构配置 | _SiteMobile_ | `-` |
| `moduleCompatible` | 模块兼容配置 | _Record<string, string>_ | `-` |

#### 模块适配对象

一些外部依赖可能需要进行模块语法的适配,以达到可以正确编译到`commonjs``esmodule`的目的,例如`dayjs``esmodule`写法是

```js
import dayjs from 'dayjs/esm'
```

而为了构建`commonjs`时的写法是

```js
import * as dayjs from 'dayjs'
```

在项目中我们拥抱`esmodule`模块使用第一种写法,并做如下配置进行适配

```js
// varlet.config.js
module.exports = {
moduleCompatible: {
"import dayjs from 'dayjs/esm'\n": "import * as dayjs from 'dayjs'\n"
}
}
```

#### SiteThemes

Expand Down
32 changes: 30 additions & 2 deletions packages/varlet-ui/docs/cli.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,32 @@ The `varlet.config.js` in the project root directory is used to manage the speci
| `analysis` | Document statistics related | _SiteAnalysis_ | `-` |
| `pc` | PC-side document structure configuration | _SitePC_ | `-` |
| `mobile` | Mobile document structure configuration | _SiteMobile_ | `-` |
| `moduleCompatible` | Module compatible config | _Record<string, string>_ | `-` |

#### Module Compatible

Some external dependencies may need to be compatible with module syntax to achieve the purpose of compiling correctly to `commonjs` and `esmodule`. For example, the wording of `esmodule` of `dayjs` is

```js
import dayjs from 'dayjs/esm'
```

In order to build `commonjs`, the writing method is

```js
import * as dayjs from 'dayjs'
```

In the project, we embrace the first way of writing the `esmodule` module, and make the following configuration for adaptation

```js
// varlet.config.js
module.exports = {
moduleCompatible: {
"import dayjs from 'dayjs/esm'\n": "import * as dayjs from 'dayjs'\n"
}
}
```

#### SiteThemes

Expand Down Expand Up @@ -93,15 +119,15 @@ Code snippets are highlighted, based on [highlight.js](https://highlightjs.org/)

| Parameter | Description | Type | Default |
| ----- | -------------- | -------- | ---------- |
| `style` | highlight的css地址 | _string_ | `-` |
| `style` | highlight css link | _string_ | `-` |

#### SiteAnalysis

Statistics related to buried points

| Parameter | Description | Type | Default |
| ----- | -------------- | -------- | ---------- |
| `baidu` | 百度统计脚本地址 | _string_ | `-` |
| `baidu` | Baidu statistics script address | _string_ | `-` |

#### SitePC, SiteMobile

Expand All @@ -116,6 +142,7 @@ module.exports = {
'en-US': 'A components library',
},
header: {
darkMode: null,
i18n: null,
github: 'https://github.com/haoziqaq/varlet',
},
Expand Down Expand Up @@ -157,6 +184,7 @@ module.exports = {
'en-US': 'A components library',
},
header: {
darkMode: null,
i18n: null,
github: 'https://github.com/haoziqaq/varlet',
},
Expand Down
26 changes: 26 additions & 0 deletions packages/varlet-ui/docs/cli.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,32 @@ yarn dev
| `analysis` | 文档统计相关 | _SiteAnalysis_ | `-` |
| `pc` | pc端文档结构配置 | _SitePC_ | `-` |
| `mobile` | mobile端文档结构配置 | _SiteMobile_ | `-` |
| `moduleCompatible` | 模块兼容配置 | _Record<string, string>_ | `-` |

#### 模块适配对象

一些外部依赖可能需要进行模块语法的适配,以达到可以正确编译到`commonjs``esmodule`的目的,例如`dayjs``esmodule`写法是

```js
import dayjs from 'dayjs/esm'
```

而为了构建`commonjs`时的写法是

```js
import * as dayjs from 'dayjs'
```

在项目中我们拥抱`esmodule`模块使用第一种写法,并做如下配置进行适配

```js
// varlet.config.js
module.exports = {
moduleCompatible: {
"import dayjs from 'dayjs/esm'\n": "import * as dayjs from 'dayjs'\n"
}
}
```

#### SiteThemes

Expand Down

0 comments on commit c51625b

Please sign in to comment.