Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exported module function does not include members #7

Closed
alexmingoia opened this issue Dec 6, 2014 · 6 comments
Closed

exported module function does not include members #7

alexmingoia opened this issue Dec 6, 2014 · 6 comments

Comments

@alexmingoia
Copy link
Contributor

/**
 * @module myModule
 */

module.exports = function foo () { ... }

exports.bar = function () { ... }
{
    "params": [],
    "name": "bar",
    "longname": "module:myModule.bar",
    "kind": "function",
    "memberof": "module:myModule",
    "scope": "static",
    "codeName": "exports.bar"
  },

exports.bar is missing from the generated docs... but seems to be parsed correctly in the output of jsdoc-parse. I'll investigate further if I have time. Exporting a class doesn't present this problem.

@75lb
Copy link
Member

75lb commented Dec 6, 2014

hi @alexmingoia .. i think you have encountered this jsdoc bug jsdoc/jsdoc#679

@75lb
Copy link
Member

75lb commented Dec 6, 2014

i will try to reproduce your issue asap and offer some suggestions

@75lb
Copy link
Member

75lb commented Dec 24, 2014

Hi, i'm back.. sorry for delay.. so, yes - it's a jsdoc bug.. this is how i workaround it for modules which export a function:

/**
this module exports a function to add two numbers
@module sum-ting
*/
module.exports = sum;

/**
the function
@param {number} - the first number
@param {number} - the second number
@returns {number} the calculation result
@alias module:sum-ting
*/
function sum(one, two){};

/**
an additional static property
*/
sum.sumthingStatic = 1;

@75lb
Copy link
Member

75lb commented Dec 26, 2014

hi @alexmingoia , can you point me to the project you are having this issue with so i can reproduce it for myself?

meanwhile, i tested the next version of jsdoc2md on one of your projects, how does it look? https://github.com/75lb/asserted

@alexmingoia
Copy link
Contributor Author

The next version looks great! 👍

Thanks for looking into this. I'm using the workaround you suggested. I'm actually using jdoc2md for all my projects where I can. I have a node/browser scaffolding module I use that I've incorporated jsdoc2md into: slush-js-skeleton.

@75lb
Copy link
Member

75lb commented Jan 10, 2015

sup alex.. i packaged up a pre-release version for you to play with..

install it
$ npm install -g jsdoc-to-markdown@next

then try it for yourself, on say asserted:
$ jsdoc2md -t lib/readme.hbs lib/asserted.js > README.md

take a look at the new options:
$ jsdoc2md --help

let me know of any flaws etc :)

@75lb 75lb closed this as completed Jan 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants