Update Search...

Canvas Engine Documentation

Submit Issue

Why ?

Descriptions are not sufficiently developed or codes are wrong, unfortunately it can happen. Contribute to correct or improve the content of the documentation by simply using Github

How ?

In the code, each class methods or properties have a comment block in the header. These comments have informations. Information starts with an "@" :

Class informations

/**

	@doc element
	@class Element
*/
  • @doc Id of category "/" if it's child of this category
  • @class Name of class Description of class
  • @example Text of example

Property informations

/**
	@doc manipulate/
	@property regX Position X of the point of origin.
	@type Integer
	@default 0
*/
  • @doc Id of category "/" if it's child of this category
  • @property Name of property Description of property
  • @type {Type of property}
  • @default {Default value of property}
  • @example Text of example

Method informations

/**
	@doc manipulate/
	@method test Description test
	@params {String} name Name
	@params {Integer} pos (optional) Position
	@return {Element}
	@example
	
		foo.test();
	
*/
  • @doc Id of category "/" if it's child of this category
  • @method Name of method Description of method
  • @params {Parameter type} Parameter name (optional) if this parameter is optional Parameter description
  • @return {Return type}
  • @example Text of example

What is @doc ?

YAML Files

3 files are in a folder doc :

  • doc.yml
  • doc-lang.yml
  • doc-router.yml

Every categories constitute a menu for documentation. They are defined by an identifier in doc.yml

core: 
    class:
    engine:
    scene:

Identifiers are associated with a word in doc-lang.yml

engine: Engine
core: Core
class: Class
scene: Scene

In doc-router.yml, you specify the file parser

- framework.js
- path/to/file.js

@doc tag in the code

In the comments, you specify the keyword with @doc in which category the method, property or class belongs

/**
	@doc engine
	@class Foo
*/

Informations from the class foo is displayed when the user clicks on the engine section

/**
	@doc engine/
	@method bar My Method
*/

If the name of the identifier ends with a /, informations form the method engine is displayed in submenu at the engine section

Update documentation

  1. Use Github Pull Requests to update codes and YAML files (if needed).

    Using Pull Requests

  2. Go to the next page to update the documentation : Update Doc