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

how to remove code of function in documentation? #52

Open
imperator-maximus opened this issue Oct 29, 2021 · 5 comments
Open

how to remove code of function in documentation? #52

imperator-maximus opened this issue Oct 29, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@imperator-maximus
Copy link

imperator-maximus commented Oct 29, 2021

Hi,
I try to make documentation for a function:

    /**
     * get Theme object
     * @param {string} status
     * @param {string} size
     * @param {string} disabled
     * @param {string} theme
     * @returns {object}
     */
    export function getTheme(status,size,disabled,theme) {

In Markdown and JSON I get the whole code from inside the function inside the markdown/JSON (value attribute) in "Prop" list.
How to avoid this?

Thank you!

@metonym metonym added the bug Something isn't working label Oct 29, 2021
@metonym
Copy link
Collaborator

metonym commented Oct 29, 2021

Currently, the markdown/json generation is lagging behind the TypeScript generation, which should not include the actual function code. Labelling this as a bug.

@metonym
Copy link
Collaborator

metonym commented Nov 11, 2021

@imperator-maximus What do you expect the value to be for the Markdown/JSON formats? The type instead?

@imperator-maximus
Copy link
Author

each function should have its own table for parameters:

/**
 * A quite wonderful function.
 * @param {object} - Privacy gown
 * @param {object} - Security
 * @returns {survival}
 */
function protection (cloak, dagger) {}
A quite wonderful function.

**Kind**: global function

| Param  | Type                | Description  |
| ------ | ------------------- | ------------ |
| cloak  | <code>object</code> | Privacy gown |
| dagger | <code>object</code> | Security     |

@metonym
Copy link
Collaborator

metonym commented Nov 11, 2021

The @param, @returns is currently not supported. Have you tried defining the entire signature using @type?

/** @typedef {any} Survival */
/** @type {(cloak: object, dagger: object) => Survival} */

@imperator-maximus
Copy link
Author

well that would be a workaround (@param, @returns support would be better for sure). Anyway the bug still has to be fixed somehow first that the whole function code will not be copied in markdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants