Skip to content

Commit

Permalink
Q4 revision 2 (cocos2d#185)
Browse files Browse the repository at this point in the history
* increment revision number

* added links and formatting

* Basic Concepts - index - formatting, grammar, etc

* now use this for developers, builds cocos2d-x and runs gitbook serve

* index - refinements

* index - added link to next page

* Basic Concepts - added learn section, refinements, typos

* CMake - comment out unused sections

* Basic Concepts - added learn section, refinements, typos

* Index - formatting

* Getting Started - formatting and AppDelegate additions

* Linux installation - corrected a few typos

* Director - build out new content

* Getting Started - added making a small code change

* Director - continuing improvements

* Director - added images

* added re-target Windows SDK to FAQ per community feedback

* http -> //

* refined

* sudo -v and sudo rm

* clean up URLs after SSL and nginx work

* fixed mis-use of //, new Windows developer link

* fixed mis-use of //

* removed obsolete functions

* Prebuilts - removed old gen-libs content

* deprecate prebuilts libraries
  • Loading branch information
slackmoehrle authored Jan 3, 2019
1 parent a1c0084 commit 0f2fba8
Show file tree
Hide file tree
Showing 67 changed files with 390 additions and 382 deletions.
6 changes: 3 additions & 3 deletions REWRITE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
rewrite ^/programmersguide/G /docs/en/installation/Windows.html permanent;
rewrite ^/programmersguide/H /docs/en/installation/Windows-Phone.html permanent;
rewrite ^/programmersguide/I /docs/en/editors_and_tools/cocosCLTool.html permanent;
rewrite ^/programmersguide/J http://sdkbox.com permanent;
rewrite ^/programmersguide/J //sdkbox.com permanent;
rewrite ^/programmersguide /docs/en/index.html permanent;

rewrite ^/programmers-guide/1 /docs/en/index.html permanent;
Expand All @@ -48,7 +48,7 @@
rewrite ^/programmers-guide/G /docs/en/installation/Windows.html permanent;
rewrite ^/programmers-guide/H /docs/en/installation/Windows-Phone.html permanent;
rewrite ^/programmers-guide/I /docs/en/editors_and_tools/cocosCLTool.html permanent;
rewrite ^/programmers-guide/J http://sdkbox.com permanent;
rewrite ^/programmers-guide/J //sdkbox.com permanent;
rewrite ^/programmers-guide /docs/en/index.html permanent;

# slackmoehrle 11/22/2017 - added these to re-write old numbered chapter URLs
Expand Down Expand Up @@ -105,7 +105,7 @@
rewrite ^/docs/installation/Windows-Phone /docs/en/installation/Windows-Phone.html permanent;
rewrite ^/docs/editors_and_tools/cocosCLTool /docs/en/editors_and_tools/cocosCLTool.html permanent;
rewrite ^/docs/editors_and_tools/cocos /docs/en/editors_and_tools/cocosCLTool.html permanent;
rewrite ^/docs/services/sdkbox http://sdkbox.com permanent;
rewrite ^/docs/services/sdkbox //sdkbox.com permanent;
rewrite ^/docs/static-pages/programmers-guide.html /docs/en/index.html permanent;
rewrite ^/docs/static-pages/installation.html /docs/en/installation permanent;
rewrite ^/docs/editors_and_tools /docs/en/editors_and_tools permanent;
Expand Down
18 changes: 12 additions & 6 deletions book.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,37 @@
},
"pluginsConfig": {
"github-issue-feedback-language-custom": {
"repo": "cocos2d/cocos2d-x-docs",
"repo": "cocos-creator/creator-docs",
"branch": "master"
},
"search": {
"maxIndexSize": 1000000000
},
"lunr": {
"maxIndexSize": 1000000000
},
"sharing": {
"douban": false,
"facebook": false,
"facebook": true,
"google": false,
"hatenaBookmark": false,
"instapaper": false,
"line": false,
"linkedin": false,
"messenger": false,
"pocket": false,
"qq": false,
"qq": true,
"qzone": false,
"stumbleupon": false,
"twitter": false,
"twitter": true,
"viber": false,
"vk": false,
"weibo": false,
"weibo": true,
"whatsapp": false,
"all": [
"facebook", "google", "twitter",
"weibo"
]
}
}
}
}
176 changes: 2 additions & 174 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,187 +1,15 @@
#!/bin/sh

# This script builds: Cocos2d-x-docs, Cocos Creator Manual, Cocos Creator API-Ref.

# on production this script should be run as:
# (cd /data/home/docops/cocos2d-x-docs && exec /data/home/docops/cocos2d-x-docs/deploy_cron.sh)
# This script lets developers test docs locally

echo "-----------------"
echo "Cocos2d-x-docs..."
echo "-----------------"
# First Cocos2d-x docs, we are aready in this repo when executing this script
## pull latest from github
echo "Cocos2d-x-docs -- pulling latest from GitHub..."
git pull origin master

cp -rf config/cocos2d-x.org/. ./

## make sure gitbook is up to date
echo "Cocos2d-x-docs -- ensuring GitBook is up to date..."
gitbook install

## build it
echo "Cocos2d-x-docs -- building GitBook docs...."
gitbook build

## copy some needed files
echo "Cocos2d-x-docs -- copying needed files..."
cp redirect.html.en _book/index.html
cp index.html.en ../documentation/index.html

## copy everything to deployment directory
echo "Cocos2d-x-docs -- copy everything to deployment directory..."

mv _book/ cocos2d-x/

rsync --recursive cocos2d-x ../documentation

rm -rf cocos2d-x/

git stash

echo "-----------------------"
echo "Cocos Creator Manual..."
echo "-----------------------"
## pull latest from github
echo "Cocos Creator -- building documentation..."
cd ../creator-docs

## pulling legacy version
echo "Cocos Creator -- pulling v1.9..."
git checkout v1.9
git pull origin v1.9
cp -rf config/cocos2d-x.org/. ./
echo "Cocos Creator -- building GitBook docs...."
echo "If this is your first time build this repo, please stop this process and run:"
echo "npm install gulp -g"
echo "npm install"
echo "DO NOT COMMIT: package-lock.json"
sudo npm install gulp -g
sudo npm install
echo "Cocos Creator -- ensuring GitBook is up to date..."
gitbook install
npm run build
echo "Cocos Creator -- copy everything to deployment directory..."
cp ../cocos2d-x-docs/redirect.html.en _book/index.html
mv _book/ manual/
rsync --recursive manual ../documentation/creator/1.9
rm -rf manual/
git stash

## pulling previous version
echo "Cocos Creator -- pulling v1.10..."
git checkout master
git pull origin master
cp -rf config/cocos2d-x.org/. ./
echo "Cocos Creator -- building GitBook docs...."
echo "If this is your first time build this repo, please stop this process and run:"
echo "npm install gulp -g"
echo "npm install"
echo "DO NOT COMMIT: package-lock.json"
sudo npm install gulp -g
sudo npm install
echo "Cocos Creator -- ensuring GitBook is up to date..."
gitbook install
npm run build
echo "Cocos Creator -- copy everything to deployment directory..."
cp ../cocos2d-x-docs/redirect.html.en _book/index.html
mv _book/ manual/
rsync --recursive manual ../documentation/creator/1.10
rm -rf manual/
git stash

## pulling next version
echo "Cocos Creator -- pulling v2.x.."
git checkout next
git pull origin next
cp -rf config/cocos2d-x.org/. ./
echo "Cocos Creator -- building GitBook docs...."
echo "If this is your first time build this repo, please stop this process and run:"
echo "npm install gulp -g"
echo "npm install"
echo "DO NOT COMMIT: package-lock.json"
sudo npm install gulp -g
sudo npm install
echo "Cocos Creator -- ensuring GitBook is up to date..."
gitbook install
npm run build
echo "Cocos Creator -- copy everything to deployment directory..."
cp ../cocos2d-x-docs/redirect.html.en _book/index.html
mv _book/ manual/
rsync --recursive manual ../documentation/creator
rm -rf manual/
git stash

echo "------------------------"
echo "Cocos Creator API-Ref..."
echo "------------------------"
## pull latest from github
echo "Cocos Creator API -- building documentation..."
cd ../creator-api-docs

echo "Cocos Creator API - pulling legacy version..."
git checkout v1.9
git pull origin v1.9
cp -rf config/cocos2d-x.org/. ./
echo "Cocos Creator API -- ensuring GitBook is up to date..."
gitbook install
echo "Cocos Creator API -- building GitBook docs...."
gitbook build
echo "Cocos Creator API -- copy everything to deployment directory..."
cp ../cocos2d-x-docs/redirect.html.en _book/index.html
mv _book/ v1.9/
rsync --recursive v1.9 ../documentation/api-ref/creator
mv v1.9/ api/
rsync --recursive api ../documentation/creator/1.9


#rm -rf ../documentation/api-ref/creator/v1.9/
#mv ../documentation/api-ref/creator/api/ ../documentation/api-ref/creator/v1.9/

rm -rf api/
git stash

echo "Cocos Creator API - pulling previous version..."
git checkout master
git pull origin master
cp -rf config/cocos2d-x.org/. ./
echo "Cocos Creator API -- ensuring GitBook is up to date..."
gitbook install
echo "Cocos Creator API -- building GitBook docs...."
gitbook build
echo "Cocos Creator API -- copy everything to deployment directory..."
cp ../cocos2d-x-docs/redirect.html.en _book/index.html
mv _book/ v1.10/
rsync --recursive v1.10 ../documentation/api-ref/creator
mv v1.10/ api/
rsync --recursive api ../documentation/creator/1.10


#rm -rf ../documentation/api-ref/creator/v1.9/
#mv ../documentation/api-ref/creator/api/ ../documentation/api-ref/creator/v1.9/

rm -rf api/
git stash

echo "Cocos Creator API - pulling current version..."
git checkout v2.0
git pull origin v2.0
cp -rf config/cocos2d-x.org/. ./
echo "Cocos Creator API -- ensuring GitBook is up to date..."
gitbook install
echo "Cocos Creator API -- building GitBook docs...."
gitbook build
echo "Cocos Creator API -- copy everything to deployment directory..."
cp ../cocos2d-x-docs/redirect.html.en _book/index.html
mv _book/ api/
rsync --recursive api ../documentation/creator/
mv api/ v2.0/
rsync --recursive v2.0 ../documentation/api-ref/creator

#rm -rf ../documentation/api-ref/creator/v1.9/
#mv ../documentation/api-ref/creator/api/ ../documentation/api-ref/creator/v1.9/

rm -rf v2.0/
git stash

cd ..
gitbook serve
6 changes: 3 additions & 3 deletions config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Cocos website exists:

1. English: `http://www.cocos2d-x.org/`
1. 中文:`http://www.cocos.com/`
1. English: `//cocos2d-x.org/`
1. 中文:`//www.cocos.com/`

the gitbook be published twice, links are different on both. So add the config to adapt this.

Expand All @@ -14,4 +14,4 @@ Config of the master branch will be for cocos.com, if you need to change config
```sh
cd to docs root dir
> cp -rf config/cocos2d-x.org/ ./
```
```
2 changes: 1 addition & 1 deletion config/cocos2d-x.org/en/_layouts/website/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% block book_header %}
<div class="cocos-navbar navbar-collapse" id="navbar" role="navigation">
<ul class="nav navbar-nav">
<li><a href="http://cocos2d-x.org" class="btn" target="_blank"><img src="http://forum.cocos.com/images/logo.png" height="30" /></a></li>
<li><a href="//cocos2d-x.org" class="btn" target="_blank"><img src="//forum.cocos.com/images/logo.png" height="30" /></a></li>
<li><a href="#" class="btn autohide" onclick="toggleLanguage()">中文</a></li>
{% for item in book.products %}
{% if item.links %}
Expand Down
2 changes: 1 addition & 1 deletion config/cocos2d-x.org/en/_layouts/website/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% block book_sidebar %}
<nav role="navigation" class="autoshow">
<ul class="summary">
<li><a href="http://cocos2d-x.org" class="btn" target="_blank"><img src="http://forum.cocos.com/images/logo.png" height="30" /></a></li>
<li><a href="//cocos2d-x.org" class="btn" target="_blank"><img src="//forum.cocos.com/images/logo.png" height="30" /></a></li>
<li><a href="#" class="btn" onclick="toggleLanguage()">中文</a></li>
{% for item in book.products %}
{% if item.links %}
Expand Down
6 changes: 3 additions & 3 deletions config/cocos2d-x.org/en/book.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
"products": [
{
"name": "API Reference",
"link": "http://docs.cocos2d-x.org/api-ref/index.html"
"link": "//docs.cocos2d-x.org/api-ref/index.html"
},
{
"name": "Cocos Creator",
"links": [
{
"name": "Manual",
"link": "http://docs.cocos2d-x.org/creator/manual/"
"link": "//docs.cocos2d-x.org/creator/manual/"
},
{
"name": "API",
"link": "http://docs.cocos2d-x.org/creator/api/"
"link": "//docs.cocos2d-x.org/creator/api/"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion config/cocos2d-x.org/zh/_layouts/website/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% block book_header %}
<div class="cocos-navbar navbar-collapse" id="navbar" role="navigation">
<ul class="nav navbar-nav">
<li><a href="http://cocos2d-x.org" class="btn" target="_blank"><img src="http://forum.cocos.com/images/logo.png" height="30" /></a></li>
<li><a href="//cocos2d-x.org" class="btn" target="_blank"><img src="//forum.cocos.com/images/logo.png" height="30" /></a></li>
<li><a href="#" class="btn autohide" onclick="toggleLanguage()">English</a></li>
{% for item in book.products %}
{% if item.links %}
Expand Down
2 changes: 1 addition & 1 deletion config/cocos2d-x.org/zh/_layouts/website/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% block book_sidebar %}
<nav role="navigation" class="autoshow">
<ul class="summary">
<li><a href="http://cocos2d-x.org" class="btn" target="_blank"><img src="http://forum.cocos.com/images/logo.png" height="30" /></a></li>
<li><a href="//cocos2d-x.org" class="btn" target="_blank"><img src="//forum.cocos.com/images/logo.png" height="30" /></a></li>
<li><a href="#" class="btn" onclick="toggleLanguage()">English</a></li>
{% for item in book.products %}
{% if item.links %}
Expand Down
8 changes: 4 additions & 4 deletions config/cocos2d-x.org/zh/book.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"links": [
{
"name": "手册文档",
"link": "http://docs.cocos2d-x.org/creator/zh/"
"link": "//docs.cocos2d-x.org/creator/zh/"
},
{
"name": "API 参考",
"link": "http://docs.cocos2d-x.org/creator-api/zh/"
"link": "//docs.cocos2d-x.org/creator-api/zh/"
}
]
},
Expand All @@ -24,11 +24,11 @@
"links": [
{
"name": "手册文档",
"link": "http://docs.cocos2d-x.org/cocos2d-x/zh/"
"link": "//docs.cocos2d-x.org/cocos2d-x/zh/"
},
{
"name": "API 参考",
"link": "http://docs.cocos2d-x.org/api-ref/index.html"
"link": "//docs.cocos2d-x.org/api-ref/index.html"
}
]
}
Expand Down
7 changes: 3 additions & 4 deletions deploy_development.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

# This script builds: Cocos2d-x-docs, Cocos Creator Manual, Cocos Creator API-Ref.

# on production this script should be run as:
# (cd /data/home/docops/cocos2d-x-docs && exec /data/home/docops/cocos2d-x-docs/deploy_cron.sh)

echo "-----------------"
echo "Cocos2d-x-docs..."
echo "-----------------"
# First Cocos2d-x docs, we are aready in this repo when executing this script
## pull latest from github
echo "Cocos2d-x-docs -- pulling latest from GitHub..."
git checkout master
git pull origin master

cp -rf config/cocos2d-x.org/. ./
Expand Down Expand Up @@ -45,7 +43,8 @@ echo "-----------------------"
## pull latest from github
echo "Cocos Creator -- building documentation..."
cd ../creator-docs
rm -rf node_modules/
sudo -v
sudo rm -rf node_modules/

## pulling legacy version
echo "Cocos Creator -- pulling v1.9..."
Expand Down
Loading

0 comments on commit 0f2fba8

Please sign in to comment.