Welcome on the repository of the official documentation of Babylon.js.
Before beginning, please be sure to have these packages installed:
git clone https://github.com/BabylonJS/Documentation.git && cd Documentation
Clone this repositorynpm install
to install all dependenciesgrunt build
to build documentationgrunt serve
runs the server and open a tab in your default browser
You don't need to edit html yourself: edit markdown files and use:
grunt build
to rebuild html from markdown and index the search.
If you want to edit some styles or see your changes without repeating grunt build
, then use grunt serve
.
grunt serve
features:
- Opens automatically the browser at
localhost:3000
- Watcher on markdown
- Recompile everything on detected change
If you want to add/update a tutorial, an extension or a class, you have to follow these steps:
- Fork the repo with the corresponding icon on Github.
- Clone the forked repo on your computer.
- Head to content folder. All markdowns files are located in this folder.
- Edit markdown according to your need
- Use
grunt build
- Pull request :)
NB: Sections like:
---
ID_PAGE: 24441 // Id of the page in the old doc, use to forward links
PG_TITLE: Cheetah3D // Name of the page in the old doc
TAGS:
- Cheetah3D // Deprecated, will be remove soon, except for classes
---
Are YAML meta description for files, this is used to make some link between the old and the new documentation.
Wherever you find these, please don't touch them :)
Categories classify the content, it is implemented and can be seen in: * tutorials * exporters * extensions
If you want to add your own:
- Head to the root of exporters or extensions or tutorials
- Create a new folder (or use an existing one)
- Fill it with your markdown
- Head to data/statics.json
- Add your folder and files
- Use
grunt build
- Pull request :)
The three root arrays are mandatory, when displayed, object's order is kept.
Here is how the object is structured:
{
"tutorials": [ // Mandatory
{ // This object represents a folder inside the tutorials folder
"title": "title displayed", // The title displayed in the list of folders
"name": "foldername", // The folder name with no spaces, no special chars except underscores
"img": "img/tutorials/name.jpg", // Place your image inside the public/img/tutorials/
"desc": "my great tutos serie", // This is the description of the folder, don't make it too long :)
"files": [ // This is the list of files inside your folder
{
"title":'tuto title', // The title displayed in the list of tutorials
"filename":'tuto title', // The file name with no spaces, no special chars except underscores, and no extension
"hidden" : true // Should this file be hidden in the global list ? false by default
},
...
]
},
...
],
"exporters": [], // Mandatory
"extensions": [] // Mandatory
}
This can be done very easily by following these steps:
- Get a local copy of the documentation
- Head to scripts\helpers\builder\sources
- Add your typescript description file in the current folder
- Make sure your file name is like 'babylon..d.ts'
- Head to scripts\helpers\builder
- Open the config.js file
- Change the
version
and thepreviousVersion
properties - Head to content\classes
- Make sure there is no folder named like the version you want to build
- Open your command shell and run
npm run build
- Rebuild the doc:
grunt build
A TOC is automatically generated on the compilation of the general, tutorials, exporters and extensions md files into HTML. In order to get a functional TOC, you need to follow two very simple rules: * every markdown lines beginning by a series "#" will be included in the TOC * DO NOT put a link inside of your heading
If you do put a link, like this:
## [](https://awesomewebsite.com/somethingInteresting.html)Animations
... or like this:
## [Animations](https://awesomewebsite.com/somethingEvenMoreInteresting.html)
... it will be included in the TOC, but won't be clickable (meaning, user's browser won't jump to the selected content)
Also, the TOC is automatically nested. It means that if you write something like this:
# Main title
<insert content here>
## Secondary title 1
<insert content here>
### Third title
<insert content here>
## Secondary title 2
<insert content here>
## Secondary title 3
<insert content here>
You will get the following TOC:
1. Main title
1. Secondary title 1
1. Third title
2. Secondary title 2
3. Secondary title 3
NB: For safety, you need to delete yourself the version of classes in content\classes in order to rebuild the same version.
####Still doesn't work? Please leave us an issue with a link to your .d.ts and your config file.