In console:
grunt
It will make a single file file: output/indoorNavi.spec.js
In console:
grunt test
It will make a single file file: output/indoorNavi.js
npm run test
- install globally
- then run this command:
jsdoc path_to_indoorNavi.js
For api preview purposes HTML file showing api use has been created. To serve the file to play with it, please follow description below.
You need to have python3 installed on your system. Click on link to get new Python3
Install virtual environment in project root folder: pip install virtualenv
Create virtual environment: virtualenv my_venv_name
Start virtual environment: source my_venv_name/bin/activate
Install flask web server framework: pip install flask
Run server: python main.py
This is going to start server at http://127.0.0.1:3000
-
Documentation is necessary for each api element.
-
Documentation should follow JSDOC schema.
-
Description should to contain at list one example of class and class method use.
-
All public classes should have a prefix "In" before them to avoid conflicts between libraries. For example use:
INPolylineIn prefix simply means that class belongs to IndorNavi API, and as such will be interpreted by API user. -
Methods naming should fallow below schema:
actionTarget
Which means it is mandatory to use camel case notation starting from small letter, then each next word that is a part of method name should start from the capital letter. First word describes action that is going to be taken - a verb. Second word describes a target of taken action - a noun.
- Arguments in methods are always a noun and starts from small letter.
-
API should be written following the "soft rule" of fluent API, and by "soft rule" is meant to not force this API to be fluent in every end point of this API.
-
For methods that are returning values or API sensitive information it is recommended to avoid fluent API rule by all means.
Example of cases where fluid API is not recommended: area.isWithin(point); as it returns boolean value that answers the question is given point within area that method is called upon.
- For methods that are not returning values or API sensitive information it is recommended to use fluent API rule.
Example of cases where fluid API is recommended: area.setOpacity(); as it do not returns any value.