← Back to team overview

dhis2-devs-core team mailing list archive

Re: JSDoc

 

Hey Morten and JS people,

Since we will be building in AngularJS we should be using https://github.com/angular/dgeni  it is pretty much an extension for JSDoc. I created a repository with the packages as well. Which is available through NPM. (Which might be out of sync with the most current version of dgeni atm)

What something like that will result into looks like http://markionium.github.io/d2-docs/ (The top menu should work fine but the navigation is a bit wonky as Github pages does not support AngularJS html5mode as that needs server support (Which might also be a thing we have to look at if that would be important for our apps.)

Anyways as for D2 (https://github.com/Markionium/d2). What it is right now is pretty much just a collection of services and directive that i was creating while working on apps. A lot of it will need cleaning up and refactoring.

For example the thing we mentioned earlier about the bootstrapping. (I will look at that sometime next week hopefully).

Kind regards,

Mark Polak
mark@xxxxxxxxxxxxxxx
markpo@xxxxxxxxxx
+47 970 36 752

On 09 Oct 2014, at 15:22, Morten Olav Hansen <mortenoh@xxxxxxxxx> wrote:

> Hi everyone
> 
> Just wanted to tell you about JSDoc [1], its a documentation format for documenting JavaScript code, I'm already using it in dhis2.period.js, and it has many benefits.
> 
> The most obvious benefit is proper autocompletion and also type handling, as an example, please consider this:
> 
> function hello(a,b,c) {}
> hello(1,2,3);
> 
> The JS compiler/evaluator have no idea how to interpret the parameters to this function since JS is not type aware by default. So it will just accept anything.
> 
> Then please consider this:
> 
> /**
>   * @param {String} a String parameter
>   * @param {Number} a number
>   * @param {Number} Another number
>   */
> function hello(a,b,c) {}
> hello(1,2,3);
> 
> Now the IDE will say that the first argument is wrong, since it expected a string to be passed, but argument 2 and 3 is correct.
> 
> I can only vouch for IntelliJ's handling of this, but I'm going to assume Eclipse have similar mechanics in place.
> 
> For our D2js library, we will be using JSDoc all over the place, which will make it a lot easier to use within an IDE.
> 
> [1] http://usejsdoc.org/
> 
> --
> Morten
> -- 
> Mailing list: https://launchpad.net/~dhis2-devs-core
> Post to     : dhis2-devs-core@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs-core
> More help   : https://help.launchpad.net/ListHelp


Follow ups

References