Skip to content

Commit

Permalink
docs: update en-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyi7099 committed Aug 2, 2019
1 parent 1aedd61 commit bcc6b4d
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 104 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h1 align="center">AntdSite</h1>

<p align="center">
<a href="https://www.npmjs.com/package/antdsite"><img src="https://img.shields.io/npm/v/antdsite.svg" alt="Version"></a><a href="https://circleci.com/gh/YvesCoding/antdsite/tree/dev"><img src="https://circleci.com/gh/YvesCoding/antdsite/tree/dev.png?style=shield" alt="Build Status"></a>
<a href="https://www.npmjs.com/package/antdsite"><img src="https://img.shields.io/npm/v/antdsite.svg" alt="Version"></a><a href="https://circleci.com/gh/YvesCoding/antdsite/tree/master"><img src="https://circleci.com/gh/YvesCoding/antdsite/tree/master.png?style=shield" alt="Build Status"></a>
<a href="https://www.npmjs.com/package/antdsite"><img src="https://img.shields.io/npm/l/antdsite.svg" alt="License"></a>
<a href="https://www.npmjs.com/package/antdsite"><img src="https://img.shields.io/npm/dm/antdsite.svg" alt="Download"></a>
<a href="https://github.com/YvesCoding/antdsite"><img src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square" alt="prettier"></a>
Expand All @@ -17,7 +17,7 @@ AntdSite is a website generator based on [Ant Design](https://ant.design), drive

- It's easy to get started, you just need to know markdown and a little bit about JS.
- Powerful, you can write react components in markdown, referring to [mdx](https://github.com/mdx-js/mdx).
- It can directly use many components of Ant Design (https://ant.design/components/button/) to meet daily development needs.
- It can directly use many components of [Ant Design](https://ant.design/components/button/) to meet daily development needs.

## Quick Start

Expand Down
85 changes: 35 additions & 50 deletions packages/docs/docs/default-theme-config/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ footer: MIT Licensed | Copyright © 2018-present Yi(Yves) Wang

Any additional content after the `YAML front matter` will be parsed as normal markdown and rendered after the features section.

<Alert
message="Warning"
description={<p>showStar only supports <strong>GitHub</strong></p>}
type="warning"
showIcon
/>
<Alert message="Warning" description={<p>showStar only supports <strong>GitHub</strong></p>} type="warning" showIcon />

## Navbar

Expand All @@ -51,9 +46,9 @@ module.exports = {
nav: [
{ text: 'Home', link: '/', important: true }, // There will be red dots on the right of the label.
{ text: 'Guide', link: '/guide/' },
{ text: 'External', link: 'https://google.com' }
]
}
{ text: 'External', link: 'https://google.com' },
],
},
};
```

Expand All @@ -67,11 +62,11 @@ module.exports = {
text: 'Languages',
items: [
{ text: 'Chinese', link: '/language/chinese' },
{ text: 'Japanese', link: '/language/japanese' }
]
}
]
}
{ text: 'Japanese', link: '/language/japanese' },
],
},
],
},
};
```

Expand All @@ -83,8 +78,8 @@ To enable the sidebar, use `themeConfig.sidebar`. The basic configuration expect
// .antdsite/config.js
module.exports = {
themeConfig: {
sidebar: ['/', '/page-a', ['/page-b', 'Explicit link text']]
}
sidebar: ['/', '/page-a', ['/page-b', 'Explicit link text']],
},
};
```

Expand All @@ -102,7 +97,7 @@ module.exports = {
{
title: 'Group 1',
collapsable: false,
children: ['/']
children: ['/'],
},
{
title: 'Group 2',
Expand All @@ -111,12 +106,12 @@ module.exports = {
title: 'Group 3', // Max to level 2 group
children: [
/* ... */
]
}
]
}
]
}
],
},
],
},
],
},
};
```

Expand Down Expand Up @@ -148,19 +143,11 @@ Then, update your configuration to define your sidebar for each section.
module.exports = {
themeConfig: {
sidebar: {
'/foo/': [
'' /* /foo/ */,
'one' /* /foo/one.html */,
'two' /* /foo/two.html */
],
'/foo/': ['' /* /foo/ */, 'one' /* /foo/one.html */, 'two' /* /foo/two.html */],

'/bar/': [
'' /* /bar/ */,
'three' /* /bar/three.html */,
'four' /* /bar/four.html */
]
}
}
'/bar/': ['' /* /bar/ */, 'three' /* /bar/three.html */, 'four' /* /bar/four.html */],
},
},
};
```

Expand Down Expand Up @@ -190,10 +177,10 @@ module.exports = {
sidebar: {
'/foo/': [
'one' /* /foo/one.html or /foo will be redirect to /foo/one */,
'two' /* /foo/two.html */
]
}
}
'two' /* /foo/two.html */,
],
},
},
};
```

Expand All @@ -211,18 +198,16 @@ maxTocDeep: 4
---
```

## Search Box

### Built-in Search
## Built-in Search Box

You can disable the built-in search box with `themeConfig.search: false`, and customize how many suggestions will be shown with `themeConfig.searchMaxSuggestions`:

```js
module.exports = {
themeConfig: {
search: false,
searchMaxSuggestions: 10
}
searchMaxSuggestions: 10,
},
};
```

Expand All @@ -233,8 +218,8 @@ The `themeConfig.lastUpdated` option allows you to get the UNIX timestamp(ms) of
```js
module.exports = {
themeConfig: {
lastUpdated: 'Last Updated' // string | boolean
}
lastUpdated: 'Last Updated', // string | boolean
},
};
```

Expand All @@ -255,8 +240,8 @@ module.exports = {
docsBranch: 'master', // The git branch of document
editLinks: true, // // defaults to false, set to true to enable
editLinkText: 'Help us improve this page!', // custom text for edit link. Defaults to "Edit this page"
showAvatarList: true // Whether to display a list of users who edited this page, set it to false to disable
}
showAvatarList: true, // Whether to display a list of users who edited this page, set it to false to disable
},
};
```

Expand All @@ -266,7 +251,7 @@ module.exports = {
module.exports = {
themeConfig: {
// Whether to enable back to top
showBackToTop: true
}
showBackToTop: true,
},
};
```
2 changes: 1 addition & 1 deletion packages/docs/docs/guide/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ AntdSite is a website generator based on [Ant Design](https://ant.design), drive

- It's easy to get started, you just need to know markdown and a little bit about JS.
- Powerful, you can write react components in markdown, referring to [mdx](https://github.com/mdx-js/mdx).
- It can directly use many components of Ant Design (https://ant.design/components/button/) to meet daily development needs.
- It can directly use many components of [Ant Design](https://ant.design/components/button/) to meet daily development needs.

## Technology Stack

Expand Down
87 changes: 36 additions & 51 deletions packages/docs/docs/zh/default-theme-config/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,9 @@ footer: MIT Licensed | Copyright © 2018-present Yi(Yves) Wang

任何 `YAML front matter` 之后额外的内容将会以普通的 markdown 被渲染,并插入到 `features` 的后面。

<Alert
message="警告"
description={<p>showStar 只支持 <strong>GitHub</strong></p>}
type="warning"
showIcon
/>
<Alert message="警告" description={<p>showStar 只支持 <strong>GitHub</strong></p>} type="warning" showIcon />

## Navbar
## 导航栏

The Navbar may contain your page title, [Search Box](#search-box), [Navbar Links](#navbar-links), [Languages](../guide/i18n) and [Repository Link](#git-repo-and-edit-links), all of them depends on your configuration.

Expand All @@ -51,9 +46,9 @@ module.exports = {
nav: [
{ text: 'Home', link: '/', important: true }, // 标签右上会有红点显示
{ text: 'Guide', link: '/guide/' },
{ text: 'External', link: 'https://google.com' }
]
}
{ text: 'External', link: 'https://google.com' },
],
},
};
```

Expand All @@ -67,11 +62,11 @@ module.exports = {
text: 'Languages',
items: [
{ text: 'Chinese', link: '/language/chinese' },
{ text: 'Japanese', link: '/language/japanese' }
]
}
]
}
{ text: 'Japanese', link: '/language/japanese' },
],
},
],
},
};
```

Expand All @@ -83,8 +78,8 @@ module.exports = {
// .antdsite/config.js
module.exports = {
themeConfig: {
sidebar: ['/', '/page-a', ['/page-b', 'Explicit link text']]
}
sidebar: ['/', '/page-a', ['/page-b', 'Explicit link text']],
},
};
```

Expand All @@ -102,7 +97,7 @@ module.exports = {
{
title: 'Group 1',
collapsable: false,
children: ['/']
children: ['/'],
},
{
title: 'Group 2',
Expand All @@ -111,12 +106,12 @@ module.exports = {
title: 'Group 3', // 最多两层分组
children: [
/* ... */
]
}
]
}
]
}
],
},
],
},
],
},
};
```

Expand Down Expand Up @@ -148,19 +143,11 @@ module.exports = {
module.exports = {
themeConfig: {
sidebar: {
'/foo/': [
'' /* /foo/ */,
'one' /* /foo/one.html */,
'two' /* /foo/two.html */
],
'/foo/': ['' /* /foo/ */, 'one' /* /foo/one.html */, 'two' /* /foo/two.html */],

'/bar/': [
'' /* /bar/ */,
'three' /* /bar/three.html */,
'four' /* /bar/four.html */
]
}
}
'/bar/': ['' /* /bar/ */, 'three' /* /bar/three.html */, 'four' /* /bar/four.html */],
},
},
};
```

Expand Down Expand Up @@ -190,10 +177,10 @@ module.exports = {
sidebar: {
'/foo/': [
'one' /* /foo/one.html 或者 /foo 将会被重定向到 /foo/one */,
'two' /* /foo/two.html */
]
}
}
'two' /* /foo/two.html */,
],
},
},
};
```

Expand All @@ -211,18 +198,16 @@ maxTocDeep: 4
---
```

## 搜索框

### 内置搜索
## 内置搜索

你可以通过设置 `themeConfig.search: false` 来禁用默认的搜索框,或是通过 `themeConfig.searchMaxSuggestions` 来调整默认搜索框显示的搜索结果数量:

```js
module.exports = {
themeConfig: {
search: false,
searchMaxSuggestions: 10
}
searchMaxSuggestions: 10,
},
};
```

Expand All @@ -233,8 +218,8 @@ module.exports = {
```js
module.exports = {
themeConfig: {
lastUpdated: 'Last Updated' // string | boolean
}
lastUpdated: 'Last Updated', // string | boolean
},
};
```

Expand All @@ -255,8 +240,8 @@ module.exports = {
docsBranch: 'master', // 文档所在git分支
editLinks: true, // 默认是 false, 设置为 true 来启用
editLinkText: '帮助我们改善此页面!', // 默认为 "Edit this page"
showAvatarList: true // 是否显示编辑过此页面的用户用户列表, 设置为false关闭
}
showAvatarList: true, // 是否显示编辑过此页面的用户用户列表, 设置为false关闭
},
};
```

Expand All @@ -266,7 +251,7 @@ module.exports = {
module.exports = {
themeConfig: {
// 是否启用回到顶部按钮
showBackToTop: true
}
showBackToTop: true,
},
};
```

0 comments on commit bcc6b4d

Please sign in to comment.