Giter Club home page Giter Club logo

Comments (6)

tmcw avatar tmcw commented on June 14, 2024

I'm confused: are you trying to document JavaScript? If you'd like to turn off inference, there's a troubleshooting topic for that - the gist is to use the name tag to turn off inference in a standard way.

from gulp-documentation.

vwochnik avatar vwochnik commented on June 14, 2024

Well, for gulp-documentation this is off-topic, but the main issue is this:

/**
 * getter
 * @param {string} name var name
 * @return {any} value
 */
/**
 * setter
 * @param {string} name var name
 * @param {any} value value to set
 * @param {integer} param1 first parameter
 * @param {integer} param2 second parameter
 * @return {any} value
 */
function test(name, value, param1, param2) {
  if (arguments.length > 1) {
    // set stuff
  }

  // get stuff
}

Now, when you generate the documentation, you get the following function definitions within the generated HTML:

// getter ( I don't want the variables to show up here )
test(name: string, value: any, param1: any, param2: any)
// setter
test(name: string, value: any, param1: integer, param2: integer)

It is simply inaccurate to have the definition of the getter.

from gulp-documentation.

tmcw avatar tmcw commented on June 14, 2024

Can you try using @name test to avoid inference in this case?

from gulp-documentation.

vwochnik avatar vwochnik commented on June 14, 2024

That might be possible, yes. But on the other hand, then I'll be losing that object methods are always in a tree-like fashion below the object.

Also, with @name, I suddenly have no argument list behind the method. Wouldn't it be possible to generate an argument list from the @params given? Also, overloaded constructors cause a whole class with all methods to be listed twice, not just the constructor.

from gulp-documentation.

tmcw avatar tmcw commented on June 14, 2024

You can use the @memberof tag to add the tree structuring. Right now that's basically how this works: you can have inference, or you can turn it off, for a file with polyglot or for a function with @name - there's no way to just infer membership but not params or type, etc - at this point. That functionality is planned, and if you'd like to expedite it, I'd happily accept a PR.

I'll see if a test case can confirm the loss of parameter lists for this example. That might be because there's no @function tag either - re previous paragraph, that's also something that's inferred, so if you turn off inference, you'll need to declare types manually.

from gulp-documentation.

vwochnik avatar vwochnik commented on June 14, 2024

Wow thank you! This worked perfectly. Now my only problem is that overloaded constructor will re-create the same class with all members twice.

I have tried adding a @name and @class tag but still - classes with same name are created twice.

from gulp-documentation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.