This is the Cocos2d-x Documentation Repo. It is licensed under the
Creative Commons BY-SA
license.
You can read these docs online at http://www.docos2d-x.org/documentation
theme/
- custom theme for web versionblank.md
- a blank page that is used when building print versionsbuild.sh
- BASH script that build web and print versions, deploys to servermkdocs.yml
- MKDocs configurationREADME.md
- this file :-)
- Pandoc: http://johnmacfarlane.net/pandoc/getting-started.html
- A LaTex Distribution: http://www.tug.org/mactex/downloading.html
- run: sudo /usr/local/texlive/2014basic/bin/universal-darwin/tlmgr update --self
- run: sudo /usr/local/texlive/2014basic/bin/universal-darwin/tlmgr install collection-fontsrecommended
- run: sudo /usr/local/texlive/2014basic/bin/universal-darwin/tlmgr install ec ecc
- export TEXROOT=/usr/local/texlive/2014basic/bin/universal-darwin/
- export PATH=$TEXROOT:$PATH
- cd /documentation
- run mkdocs serve
Any changes made while mkdocs serve
is running are automatically rebuilt.
- cd /documentation
- run build.sh
Content is build in docs and deployed to site. This script also builds the ePub and PDF versions as well as deploys out to our staging server and http://www.Cocos2d-x.org/documentation
- make sure to break lines at 80 columns.
- edit via a pull request. Please do not edit chapters and push directly.
- if you are creating a new document, please don't make it feel and sound like an API Reference. Please tell a story about your content. We want to make this engage the user. If in doubt: read Chapter 2 and notice it feels like a chapter in a book.
- contact me via e-mail or on the forums to discuss what you want to add, edit, etc.
- each chapter has a markdown file and 3 image directories associated with it.
- the image directories are -web, -print and -img. -web is properly sized images for displaying on the web. print is properly sized images for displaying in the epub and pdf. -img is were to put the original images (also displayed when viewing from GitHub).
- the build.sh script does copying and renaming of directories during the build process since the markdown files expects files at a specific path. Take a look.
- if a chapter does not have any images there is no need to create directories for it.
To support C++, JavaScript, (and technically Lua when ready), you can easily embed div elements and put the content for that language in between:
Example for C++:
<div class="langs">
<ul>
<li><a href="#" id="tab-cpp">C++</a></li>
<li><a href="#" id="tab-js">Javascript</a></li>
</ul>
</div>
<div class="tab-cpp tab_content">
some content that is c++ specific.....
more c++ specific content....
auto mySprite = Sprite::create("mysprite.png");
even more c++ specific content....
</div>
Example for Javascript:
<div class="tab-js tab_content">
some javascript specific content...
var mySprite = Sprite.create("mysprite.png");
more javascript content....
</div>
Note: there is a blank line after the opening div and before the closing div elements. This is a markdown requirement or else it will not render properly.
Note: Also notice that the div elements are indented by a single tab. This is also a markdown requirement or else the text will not render properly.
- report via GitHub issues: https://github.com/chukong/cocos-docs/issues
- or clone and submit a pull request to fix it: https://github.com/chukong/cocos-docs/pulls