Skip to content

Commit 0914dd3

Browse files
committed
提交 3.0 文档 (cocos#1352)
1 parent b4532be commit 0914dd3

File tree

1,938 files changed

+38625
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,938 files changed

+38625
-0
lines changed

.bookignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/config/
2+
gulpfile.js
3+
.markdownlint.json
4+
package.json
5+
.gitignore
6+
.bookignore
7+
/README.md
8+
/zh/CONTRIBUTING.md
9+
*.xlsx
10+
*.orig
11+
*.less
12+
*.ai

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
*.rtf
3+
4+
5+
6+
npm-debug.log
7+
.DS_Store
8+
node_modules/
9+
output/
10+
.vscode/
11+
_book/
12+
*.epub
13+
*.pdf
14+
*.mobi
15+
*.history

.markdownlint.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"fenced-code-language": false,
3+
"line-length": false,
4+
"header-increment": true,
5+
"first-header-h1": true,
6+
"list-indent": true,
7+
"ul-indent": true,
8+
"no-trailing-spaces": true,
9+
"no-multiple-blanks": true,
10+
"commands-show-output": true,
11+
"no-missing-space-atx": true,
12+
"no-multiple-space-atx": true,
13+
"blanks-around-headers": true,
14+
"header-start-left": true,
15+
"single-title": true,
16+
"no-trailing-punctuation": true,
17+
"no-multiple-space-blockquote": true,
18+
"ol-prefix": true,
19+
"list-marker-space": true,
20+
"blanks-around-fences": true,
21+
"blanks-around-lists": true,
22+
"no-bare-urls": true,
23+
"no-space-in-emphasis": true,
24+
"no-space-in-code": true,
25+
"no-space-in-links": true,
26+
"code-fence-style": true,
27+
"single-trailing-newline": true
28+
}

LANGS.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- [English](/en)
2+
- [中文](/zh)

README.md

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Cocos Creator User Manual
2+
3+
## Requirements
4+
5+
This documentation site is powered by [GitBook](https://www.gitbook.com/). You can check out the online version [here](https://docs.cocos.com/creator/manual).
6+
7+
You need [Node.js](https://nodejs.org/en/) and npm to be able to build the site.
8+
9+
To install gitbook:
10+
11+
```bash
12+
npm install gitbook-cli -g
13+
```
14+
15+
Install gitbook plugins:
16+
17+
```bash
18+
gitbook install
19+
```
20+
21+
Install gulp and other modules:
22+
23+
```bash
24+
npm install gulp -g
25+
npm install
26+
```
27+
28+
## Preview
29+
30+
To preview the doc, run the following command:
31+
32+
```bash
33+
npm run preview
34+
```
35+
36+
Or
37+
```bash
38+
npm run preview -- -o file1,file2...
39+
```
40+
41+
The first command will build and launch web server to host the site. It will also enable live reload plugin, so your changes to the markdown source file will automatically triggers the rebuild of the docs.
42+
43+
The second command allows you to build the page that you assigned straightly. Please change the file1,file2... to your own file name, then execute preview command. And this command will help you rebuild the `.bookignore` file which can let you ignore the files that you didn't change when you rebuild the doc.
44+
45+
After generation finished, don't quit server process, run the following command in other terminal context:
46+
47+
```bash
48+
gulp prune-left-bar
49+
```
50+
51+
This will remove unused links from left bar.
52+
53+
## Build
54+
55+
If you just want to build the markdown to html, use this command:
56+
57+
```bash
58+
npm run build
59+
```
60+
61+
You can also build the doc for ebook formats (PDF, ePub, mobi), please following this guide:
62+
63+
<https://toolchain.gitbook.com/ebook.html>
64+
65+
If you need to publish to the website, you'd better build it on Mac. If use Windows, some redundant `.md` file will also generated.
66+
67+
## Content Editing
68+
69+
The markdown source of this book is in language specific folders [/en](en) and [/zh](zh). Language options are registered in [LANGS.md](LANGS.md) file.
70+
71+
### Index
72+
73+
In each language folder there is an [SUMMARY.md](en/SUMMARY.md) file, which contains all the pages to build and also this file serves as a sidebar navigation list. Any markdown source file that are not listed in this index will not be build.
74+
75+
In this index file, just write links to each markdown file in a list. Indented list is for chapters that contains expandable subs. For example:
76+
77+
```md
78+
- [Using Editor](getting-started/basics/editor-overview.md)
79+
- [Assets](getting-started/basics/editor-panels/assets.md)
80+
- [Scene](getting-started/basics/editor-panels/scene.md)
81+
- [Node Tree](getting-started/basics/editor-panels/node-tree.md)
82+
```
83+
84+
Will create a toggleable chapter title `Using Editor`. Once clicked all its subs will show up.
85+
86+
### Front page
87+
88+
[index.md](en/index.md) at each language folder is the front page of the doc.
89+
90+
### Page content
91+
92+
To change the content of each page, just edit the markdown source files. There's no specific front matter format, just make sure each page has a `h1` as the title.
93+
94+
### Customize Style and Template
95+
96+
To customize styles, modify [zh/styles/website.css](zh/styles/website.css) and [en/styles/website.css](en/styles/website.css).
97+
98+
To change HTML templates, change the content in [zh/_layouts](zh/_layouts) and [en/_layouts](en/_layouts). Check out [Templating Guide](https://toolchain.gitbook.com/templating/) for gitbook.
99+
100+
## Contribution
101+
102+
This is a dynamically updated user document, and your reading and feedback is the driving force behind our progress.
103+
104+
If you encounters any typo or content problem please [report issue](https://github.com/cocos-creator/creator-docs/issues/new) in this repo. Pull requests are welcome!
105+
106+
### Style Guide for Chinese documents
107+
108+
- [中文文档书写规范](zh/CONTRIBUTING.md)
109+
110+
- [Contributions in English](en/CONTRIBUTING.md)
111+
112+
- [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)

book.json

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"title": "Cocos Creator",
3+
"plugins": [
4+
"-lunr",
5+
"-search",
6+
"search-title",
7+
"anchorjs",
8+
"sharing",
9+
"splitter",
10+
"theme-default-customize@git+https://github.com/cocos-creator/theme-default.git",
11+
"github-issue-feedback-language-custom@git+https://github.com/cocos-creator/gitbook-plugin-github-issue-feedback.git",
12+
"expandable-chapters-small@git+https://github.com/cocos-creator/gitbook-plugin-expandable-chapters-small.git"
13+
],
14+
"styles": {
15+
"website": "./styles/website.css"
16+
},
17+
"pluginsConfig": {
18+
"github-issue-feedback-language-custom": {
19+
"repo": "cocos-creator/creator-docs",
20+
"branch": "master"
21+
},
22+
"search": {
23+
"maxIndexSize": 1000000000
24+
},
25+
"lunr": {
26+
"maxIndexSize": 1000000000
27+
},
28+
"sharing": {
29+
"douban": false,
30+
"facebook": true,
31+
"google": false,
32+
"hatenaBookmark": false,
33+
"instapaper": false,
34+
"line": false,
35+
"linkedin": false,
36+
"messenger": false,
37+
"pocket": false,
38+
"qq": true,
39+
"qzone": false,
40+
"stumbleupon": false,
41+
"twitter": true,
42+
"viber": false,
43+
"vk": false,
44+
"weibo": true,
45+
"whatsapp": false,
46+
"all": [
47+
"facebook", "google", "twitter",
48+
"weibo"
49+
]
50+
}
51+
}
52+
}

en/CONTRIBUTING.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Contributions in English
2+
3+
## Using Bold
4+
5+
- to note step numbers.
6+
- __Example__: __First__, __Second__, __Third__, etc
7+
- to designate important Creator Components, Objets, UI Elements.
8+
- __Example__: __Scene__, __Sprite inspector__, __Sprite__ inspector, __Asset panel__ or __Asset__ panel
9+
10+
## List items
11+
12+
- __Example__: *apple*, *orange*, *banana*, and *pear*
13+
- __Example__:
14+
- apple
15+
- orange
16+
- pear
17+
18+
## Using a single backtick (code wrapper)
19+
20+
- designate class names, property names and function names.
21+
- __Example__: `SpriteComponent`, `onEnable`, `SpriteComponent.spriteFrame`
22+
- filenames and paths.
23+
- __Example__: `myfile.txt`, `/mypath/myfile.txt`, `/assets/xyz/`
24+
25+
## Using a triple backtick
26+
27+
- code blocks
28+
29+
## Tables
30+
31+
Can bold or italics the first colume but bot the second column. __Examples__:
32+
33+
| Properties | Explanation |
34+
| --- | --- |
35+
| anisotropy | Anisotropy value |
36+
| minFilter | Narrowing Filter Algorithm |
37+
38+
| Properties | Explanation |
39+
| --- | --- |
40+
| **anisotropy** | Anisotropy value |
41+
| **minFilter** | Narrowing Filter Algorithm |
42+
43+
| Properties | Explanation |
44+
| --- | --- |
45+
| *anisotropy* | Anisotropy value |
46+
| *minFilter* | Narrowing Filter Algorithm |
47+
48+
## Grammar suggestions
49+
50+
- __Firstly__ -> __First__.
51+
- At present, —> Currently,
52+
- Cocos Creator —> __Cocos Creator__ (let's bold our product name
53+
- **Note**: —> > **Note**:
54+
- Related Reference Links —> Reference documentation
55+
- do not use phrases like: "Now let me explain", "he should do this"
56+
- text like this should be avoided: "If you have never written a program and don’t worry, we will provide all the required code in the tutorial, just copy and paste it to the correct location, and then you can find your programmer partner to solve this part of the work. Let's start creating the script that drives the main character's actions."
57+
58+
## Technical designations
59+
60+
- json -> JSON
61+
- js or JS -> JavaScript
62+
- ts or TS -> TypeScript

0 commit comments

Comments
 (0)