jsdoc2md / jsdoc-to-markdown

Generate markdown documentation from jsdoc-annotated javascript
MIT License
1.69k stars 152 forks source link

Respect @ignore tags #14

Closed azaslavsky closed 9 years ago

azaslavsky commented 9 years ago

Currently, adding the @ignore tag to a jsDoc block has no effect. It would be nice if ignore tags did exactly what it says on the tin.

75lb commented 9 years ago

i can't reproduce this.. this code works correctly for me (with the ignored var not present in the output)..

/**
a visible global
*/
var visible = true;

/**
an ignored global
@ignore
*/
var invisible = true;

can you send an example of an @ignore tag failing?

azaslavsky commented 9 years ago

Yeah. I'm about to push some commits on a repo I'm working on, I'll link it when I do.

azaslavsky commented 9 years ago

So, head over to backbone.hashMate's repository and do a dev install on NPM. If you run gulp api, it should use gulp-jsdoc-to-markdown in the task. The output will be visible in docs/API.md. In my attempts, Backbone.History.prototype.checkUrl is still visible in the API output, even though it has been marked with an @ignore tag.

75lb commented 9 years ago

fixed in jsdoc-parse.. run npm update in your project then try gulp api again.. thanks for report :+1:

azaslavsky commented 9 years ago

You the man (or woman)! Thanks for the super quick turnaround. :+1:

75lb commented 9 years ago

lolz! I'm Lloyd Brookes, a male full-stack javascript fan based in London.. just to de-mystify myself a little ;)

PS. i'm almost ready for alpha-testing on jsdoc2md@next, will give you a shout soon about that..

azaslavsky commented 9 years ago

Yeah, love the library, happy to contribute.

75lb commented 9 years ago

quick preview of the new format https://github.com/75lb/backbone-hashMate/blob/master/docs/API.md

azaslavsky commented 9 years ago

Oh wow, the table format is so much easier to read. Also appreciate you adding support for parameters that are more than one level deep in an object dictionary (ex: opts.deleteHash.groups is on the same indentation level as opts.deleteHash and written in a confusing way in the previous version, as seen here). Excited for the release!

azaslavsky commented 9 years ago

Hmm, I very strongly prefer the look and feel of the new layout. What would I have to do to start using it now? Is there any chance you could make a pre-release of the gulp-jsdoc-to-markdown plugin, something like 0.1.6-alpha1? Would love to give it a whirl.

75lb commented 9 years ago

hi :)

ok.. run npm install -g jsdoc-to-markdown@next but i am still working on it - use at own risk ;)

see jsdoc2md --help for latest options (which will change soon)

75lb commented 9 years ago

one little tip, if you want your @examples to be automatically syntax-highlighted as js, use $ jsdoc2md --example-code-gfm js lib/source.js

these options will change, but this is the current state

azaslavsky commented 9 years ago

Found another bug in 0.6.2: when a @param (though probably any tag that accepts variable types), has several possible types specified (ex: @param {boolean|string|number} someName), each type gets its own column, rather than being listed as type1|type2|...|typeN in a single column. This is probably due to a confusion of the gfm table row syntax with the jsDoc variable type syntax.

An example (scroll to history.navigate):

http://jbt.github.io/markdown-editor/#7VlLbxs3EL7rV7A2kNquZN9tx4CTBk2AtA3yQA+JEVC7I4nxarkluVIE+N57f2J/SWeG3Kd3pXVipzk0h0jaHQ7n9X0zpM+lSOUSHu89kdH1VKewd3F+Ii9G+/vFg9HoSLwvflwdlM8PR0LgmyiR1p6K4+fKOm02NYHiEQmS6EeVWifTCD7yA159jE+MO9CZUzq1hx2r91nisLYklSs1lw4O3s+MnC8hdVdj8R5V2KtOBYV8XUcMCTh4Lu3iwK9EDbjPHFy3jkr+UPzz19/iPNIxXPw+/QSROz/hHzXtWZJH1155Jo1csvq50XnWrb2Uryu3zqh0HpSLDzc79rTgeEe/YeXO1tCERUN8WkoXLUj4Ddt14M27RPX+25PuHVrL6jtNtU5Aph3hk8ZCbauwQ0/smsJDXJl7r4dob4gO0W0bustk7EzB7R0a+R+NzttALTSUgN0PUGwLjC5TAZ8dpDHEYgXGItSEngm3ABHDTOaJu7VGXL56MWLkD8P3LXTfGdtfj+yHxPW3R/XDYvqbIfph8fxwaP5vsOwBUSF6f+Gft6A0ekZw7sIxy+WZmOVpRLIyUW5zJtZGZrYhuAS30PFYyJVUiZwmIKQ7FQvnstOTk2kw65M91mZ+sh+sm7D20ehGvKJYiBvxdpMBfvwMNjKKjRM3+HpC/4T/DB/hH78ObojO4ietNTsLWc0yYzHNnVAzMdVuIbKcYo34FzKNxQIj/yv/MCCcyWEslBNrlSQCUvYQoerACAOSYyOc5kUiWsh0DlZIK9aA4viZ6cyyZlghC6Gp25JW0FBH3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NgsmJU/I9GOrCnMWTw9+bGLPGgQBNaNani9kCtuaQqNX6dBQ3VSQ5s1DvtGxTGkP/RU5qCpa0IHCH8wEJHGNqlS70s9XK0y8fQsLAriKcGPZGj+Gvw0YvMpIqYS4IVbMRAuBLoO9LuudnrbKQ6+D1vq3qSvn3HfvX7RnnNDTENacFyj01LKc3x72KUjva8TlMF+4tQqpMR+J6Q5YPR4o5dQXXfctUO9mIV7jDX8iMZ9yi3B0B8uO80rRno8RxigCRLHaMrKWlkYe/cpmGiMmiq6UKBWlDAVrfElkqgpLxywsycJxD44/pLhi0bt0omwgqd+uisGGRN/cRo8642JDlahHqRvNuE62jfLmdHLkD30T5sYWjbhTulLhfUjkztYVrPGE2ZBFNWhqBjfOBpliLhm/BKWD3WdeAtCvSGzIWlGepkpiif78DAdt3Uz28E6A658+69zn6ILdFSUbJDXIORcUvjq5zdiSs9RX89FwcBeiF82AU5Hwg1TB3saiiP4toUpdqg5CLzASKmfVLtQeNiT3Vb9TfwA6o/CG79RcU1UPIx1+qPbPmQ1b8u7Rq2+y/feBvNWXhdJLuueYmEzLGyqZx5jlaOixtQrl1Mo7nfY8vveJWPsJ1LlQkWLJpmv+8m8mrsGj8GX99HHYvAtMvSzbRlu/M2iI789f/7oze4vRk4bNVyL44Nk7ta9bjtznkA7U7elD39B6lrzQO2+GIEZl8mzm+VUJ8WHgSVOpPGQMa83R1v/kNT7Z6JLGhKKPnifSWoNeLcTxPQ9qxV6JpU/sWAbmyocPsNJNgzCzVvNMpPAtwMY35Q1hqMDu/L/9PS9TE+7D1geOOg6IrICSTGO/As=

75lb commented 9 years ago

this could be an issue with this particular markdown editor - that same markdown works fine on github https://github.com/75lb/backbone-hashMate/blob/master/docs/API.md

75lb commented 9 years ago

you can paste the table directly into these comments and it looks fine

Param Type Description
[fragment] string The new fragment
[opts] Object An extended version of the default options object, with the following properties available
[opts.deleteHash=false] boolean Object True means we reset the entire hash, false means that nothing is cleared
[opts.deleteHash.globals=false] boolean Array.<string> Setting true will clear all global variables, or an array can be specified for more granular deletion
[opts.deleteHash.groups=false] boolean Array.<string> Setting true will clear all prefixed variables, or an array can be specified for more granular deletion
[opts.addHash] string Object Either an encoded string or a key->value dictionary of hash parameters to be changed along with the fragment; this will be applied after the "clear" variables are processed
[opts.forceTrigger=false] boolean True forces a triggered URL to load, even if the URL matches the current one; only used it "opts.trigger" is also true
[opts.replace=false] boolean Works exactly like the default "navigate" implementation, see http://backbonejs.org/#Router-navigate
[opts.trigger=false] boolean Works exactly like the default "navigate" implementation, see http://backbonejs.org/#Router-navigate
azaslavsky commented 9 years ago

You're totally right - it was the previewer that was the problem, not your code. Oops!

Either way, I'm now using the pre-release build for the library's documentation to excellent effect! Thanks!