jdalton / docdown

A simple JSDoc to Markdown generator.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linking separate file with examples

abozhilov opened this issue · comments

What I ever wanted is instead of put the examples of the usage directly in source code, to have separate file with examples, which will be used for generated examples in the documentation.
We will have double bonus from that. Clean source code, and good examples in the documentation.

+1, could you give an example of what the JSDoc comment block would look like.

I thought a little bit different strategy. Instead of linking every method I though about general examples file as:
https://gist.github.com/4163571
The body of the functions are the examples, which will be used in the documentation.

During the generation of the documentation there will be an option 'examples' => 'examples.js'.
This also give the ability of the user to easy load the examples.js and fire some examples.

What do you think about? This separation is not strong coupled and your code could be redistributed without or with different examples.

Closing as stale.