Skip to content

Commit

Permalink
docs(guide): 调整内置组件导航为二级
Browse files Browse the repository at this point in the history
  • Loading branch information
KuangPF committed Jul 16, 2023
1 parent 0841aeb commit 1374bff
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 63 deletions.
18 changes: 13 additions & 5 deletions example/docs/config/markdown.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,29 @@ nav:
order: 2
title: Markdown Config
---

All Markdown configurations are configured in the form of FrontMatter at the top of the Markdown file, for example

```
---
title: configure page title
---
Additional Markdown content
```

Currently the theme supports the following Markdown configurations.

## Multi-level sidebar

> This configuration needs to be distinguished from the `sidebarEnhance` parameter. The `sidebarEnhance` parameter is to deal with issues such as multi-level file directories, custom sidebars, and preventing multi-level sidebar clicks and jumps. The Markdown configuration is in the same Under the file directory, functions such as grouping and three-level sidebars are realized through configuration.
<Alert type="warning" showIcon closable>
This configuration only takes effect in non-<code>sidebarGroupModePath</code> mode.
This configuration only takes effect in none <code>sidebarGroupModePath</code> mode.
</Alert>

Configuring multi-level sidebars mainly depends on two fields `group` and `type`, `group` configures the first-level sidebar, and `type` configures the second-level sidebar.
First level sidebar configuration:
Configuring multi-level sidebars mainly depends on two fields `group` and `type`, `group` configures the first-level sidebar, and `type` configures the second-level sidebar. First level sidebar configuration:

```
<!-- /xx/a.md -->
---
Expand All @@ -39,9 +42,11 @@ order: 1
title: '布局'
---
```

![side-menu-1](https://github-production-user-asset-6210df.s3.amazonaws.com/20694238/242193437-38a1cd75-493f-4c23-96d2-0ecd2fad662c.png)

Second level sidebar configuration:

```
<!-- /xx/c.md -->
---
Expand All @@ -66,13 +71,15 @@ order: 0
title: '数据可视化页'
---
```

![side-menu-2](https://github-production-user-asset-6210df.s3.amazonaws.com/20694238/242193448-133ef65c-7ad6-4531-adcd-5e70d9bda289.png)

The `group` field type supports object format, which is used to adjust the display order of `group`. For example, setting the `order` field in `group` can adjust the order of `global style` and `design mode`:

```
<!-- /xx/a.md -->
---
group:
group:
title: '全局样式'
order: 2
order: 1
Expand All @@ -88,4 +95,5 @@ order: 0
title: '概览'
---
```
![side-menu-3](https://github-production-user-asset-6210df.s3.amazonaws.com/20694238/242193454-eb63d438-1cd8-41d1-8563-c628245bda09.png)

![side-menu-3](https://github-production-user-asset-6210df.s3.amazonaws.com/20694238/242193454-eb63d438-1cd8-41d1-8563-c628245bda09.png)
7 changes: 2 additions & 5 deletions example/docs/guide/builtins-alert.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
---
group:
title: 内置组件
order: 2
group: 内置组件
title: 警告提示
order: 1
---

## Alert <Badge>0.2.5+</Badge>

警告提示,展现需要关注的信息,使用方法同 `antd` [Alert](https://ant.design/components/alert-cn) 组件,该组件支持 `type``closable`以及`showIcon`参数,类型与之保持一致。

```markdown
Expand Down
Original file line number Diff line number Diff line change
@@ -1,58 +1,9 @@
---
order: 3
title: 内置组件
group: 内置组件
title: 图片预览
order: 2
---

为了更加方便地在 Markdown 中使用一些组件,增强 Markdown 展示效果,主题内置一些常见组件,具体如下:

## Alert <Badge>0.2.5+</Badge>

警告提示,展现需要关注的信息,使用方法同 `antd` [Alert](https://ant.design/components/alert-cn) 组件,该组件支持 `type``closable`以及`showIcon`参数,类型与之保持一致。

```markdown
<Alert>
Text
</Alert>

<Alert type="success" showIcon >
Success Text
</Alert>

<Alert type="info">
Info Text
</Alert>

<Alert type="warning">
Warning Text
</Alert>

<Alert type="error" closable >
Error Text
</Alert>
```

<Alert>
Text
</Alert>

<Alert type="success" showIcon >
Success Text
</Alert>

<Alert type="info">
Info Text
</Alert>

<Alert type="warning">
Warning Text
</Alert>

<Alert type="error" closable >
Error Text
</Alert>

## ImagePreview <Badge>0.2.7+</Badge>

图片预览组件,需要展示图片时使用。该组件支持 `float` 以及 `pure` 两个参数,用于控制图片展示效果。

### 基础使用
Expand Down
13 changes: 13 additions & 0 deletions example/docs/guide/builtins-overview.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
group:
title: 内置组件
order: 3
order: 0
title: 概览
---

为了更加方便地在 Markdown 中使用一些组件,增强 Markdown 展示效果,主题内置一些常见组件,具体包含以下组件:

- [Alert](./builtins-alert.zh-CN.md) <Badge>0.2.5+</Badge>
- [ImagePreview](./builtins-image-preview.zh-CN.md) <Badge>0.2.7+</Badge>
- [Alert](./builtins-alert.zh-CN.md)
2 changes: 1 addition & 1 deletion example/docs/guide/changelog.en-US.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
order: 4
order: 5
title: Change Log
toc: false
timeline: true
Expand Down

0 comments on commit 1374bff

Please sign in to comment.