BabylonJS/Documentation

Name: Documentation

Owner: Babylon.js

Description: BabylonJS documentation page

Created: 2016-01-25 21:16:40.0

Updated: 2018-05-24 18:37:09.0

Pushed: 2018-05-24 00:48:16.0

Homepage: http://doc.babylonjs.com

Size: 111326

Language: CSS

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Babylon.js - Official documentation website

Welcome on the repository of the official documentation of Babylon.js.

Prerequisites

Before beginning, please be sure to have these packages installed:

Run a local copy of the documentation
Updating a local copy of a fork of the documentation

See configure a remote for a fork and syncing a fork for additional github documentation.

Updating a local copy of the documentation
Useful command

You don't need to edit html yourself: edit markdown files and use:

ou want to edit some styles or see your changes without repeating ```grunt build```, then use ```grunt serve```.
How to contribute?
Update content

If you want to add/update a tutorial, an extension or a class, you have to follow these steps:

  1. Fork the repo with the corresponding icon on Github.
  2. Clone the forked repo on your computer.
  3. Head to content folder. All markdowns files are located in this folder.
  4. Edit markdown according to your need
  5. Use `grunt build`
  6. 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 :)

New Content

Categories classify the content.

Categories

They are implemented and can be seen in:

* [Babylon 101](http://doc.babylonjs.com/babylon101)
* [How To](http://doc.babylonjs.com/How_To)
* [Features](http://doc.babylonjs.com/features)
* [resources](http://doc.babylonjs.com/resources)
* [extensions](http://doc.babylonjs.com/extensions)
* [samples](http://doc.babylonjs.com/samples)
Adding Content

If you want to add your own content:

  1. Head to the root of How To, features, resources, samples or extensions or How_To
  2. Create a new folder (or use an existing one)
  3. Fill it with your markdown
  4. Head to data/statics.json
  5. Add your folder and files
  6. Use `grunt build`
  7. Pull request :)
statics.json structure

The three root arrays are mandatory, when displayed, object's order is kept.

Here is how the object is structured:

{
    "How_To": [                         // Mandatory
        {                                  // This object represents a folder inside the How_To 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/How_To/name.jpg", // Place your image inside the public/img/how_to/
          "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 How_To 
                "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
            },
            ...
          ]
        },
        ...
    ],
    "features": [],                       // Mandatory
    "resources": [],                       // Mandatory
    "extensions": []                       // Mandatory
}
Build documentation for your own version of BabylonJs

This can be done very easily by following these steps:

  1. Get a local copy of the documentation
  2. Head to scripts\helpers\builder\sources
  3. Add your typescript description file in the current folder
  4. Make sure your file name is like 'babylon..d.ts'
  5. Head to scripts\helpers\builder
  6. Open the config.js file
  7. Change the `versionand the ``previousVersion``` properties
  8. Head to content\classes
  9. Make sure there is no folder named like the version you want to build
  10. Open your command shell and run `npm run build`
  11. Rebuild the doc: `grunt build`
How to structure your document to get a functional Table Of Content (TOC)

A TOC is automatically generated on the compilation of the general, How_To, features, resources 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.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.