We always welcome contributions to our documentation.
- Fork our docs repo
- en/ is for English contributions, zh/ is for 中文 contributions.
- code blocks must be wrapped in special code to work correctly:
- C++ only code block:
{% codetabs name="C++", type="cpp" -%} auto mySprite = Sprite::create("mysprite.png", Rect(0,0,40,40)); {%- endcodetabs %}
- C++ only code block:
- Test your changes using
gitbook build
andgitbook serve
. Please test in a few web browsers. See Requirements. - Submit a pull request with your changes and we will review and merge it.
This documentation site is powered by GitBook. You need Node.js and npm to be able to build the site.
To install gitbook:
npm install gitbook-cli -g
Install gitbook plugins:
gitbook install
To preview the doc, run the following command in cocos2d-x-docs dictionary:
gitbook serve
This will build and launch web server to host the site. It will also enable livereload plugin so your changes to the markdown source file will automatically triggers rebuild of the docs.
If you just want to build the markdown to html, use this command:
gitbook build