jsdoc

Javascript: Move JSDoc's outside of code

房东的猫 提交于 2021-02-08 05:08:29
问题 I ask this mostly from a Angular perspective (but any advice would help). I have JSDoc's on my functions but it makes the code look very messy. I would just like to know if there is a way to move the JSDoc's to some type of external file. An example of my JSDoc's: /** * Does a GET call on the service MyGetCall * @param {string} pUserID - 1st Parameter: User Login ID * @param {string} pPassword - 2nd Parameter: User Password * @returns The Call's Http Observable (subscribe to this function). *

Javascript: Move JSDoc's outside of code

老子叫甜甜 提交于 2021-02-08 05:08:09
问题 I ask this mostly from a Angular perspective (but any advice would help). I have JSDoc's on my functions but it makes the code look very messy. I would just like to know if there is a way to move the JSDoc's to some type of external file. An example of my JSDoc's: /** * Does a GET call on the service MyGetCall * @param {string} pUserID - 1st Parameter: User Login ID * @param {string} pPassword - 2nd Parameter: User Password * @returns The Call's Http Observable (subscribe to this function). *

How to document destructured variable with jsdoc

一笑奈何 提交于 2021-02-07 16:24:08
问题 I have something like this: let { total } = settings; How do I document the total variable? I tried something like this: /** * @type {Object} * @property {String} total.test */ let { total } = settings; but it doesn't seem to be the right way. Any suggestions? 回答1: @Tommy-Pepsi Gaudreau was so close in his comment on the original question. Here's an example in the closure compiler tool @ closure-compiler.appspot.com let /** @type {Object<string|boolean>} */ settings = {}; let str = 'string';

JSDoc output as JSON for spa integration

£可爱£侵袭症+ 提交于 2021-01-29 07:23:30
问题 I'm currently building a webshop with node.js and I wanted to include a documentation of pretty much all of my commented javascript code. I can easilly create a documentation with JSDoc and create a pretty html documentation, but that's not what I want to have. I want to create a navigation in my website where the documentation is integrated in my spa. So I have done some research and found some npm modules like jsdoc-x which creates JSON based of the JSDoc comments, but it is rather cryptic

How to parse JSDoc

时光总嘲笑我的痴心妄想 提交于 2021-01-28 20:00:23
问题 I have an HTML file. There are some JSDoc inside like this: /** * If true, this slider is disabled. A disabled slider cannot be tapped * or dragged to change the slider value. * * @attribute disabled * @type boolean * @default false */ I need to get info and put into a bean class MyBean { public String comment; public String attribute; public String type; public String defaultValue; } How do I parse my HTML file? 回答1: There are several JSDoc parsers out there. Take a look into doctrine and

How do you view a function's documentation with Visual Studio Code's Intellisense?

蓝咒 提交于 2021-01-28 05:16:51
问题 I'm writing Javascript with Visual Studio Code on a Mac. I have this function, documented in JSDoc format: /** * Adds the passed Matter Body to the simulation. * @param {Matter.Body} body - The body to add to the physics simulation * @param {string} imageUrl - The URL of the image to use to represent this body in the simulation. It should match an image URL that has already been added via loadImages() * @param {function} [onCollide] - Optional function to call when this body collides */

jsdoc @ character inside code block

喜夏-厌秋 提交于 2021-01-22 04:53:52
问题 I'm trying to write documentation for a Module function like this: /** * Usage: * * ``` * @NgModule({ * imports: [ * BrowserModule, * ..., * ThisModule.forRoot({ * name: 'Name', * version: '1.0', * ], * }), * ``` * * @param config Service configuration parameters */ public static forRoot(config: SVConfig) { The problem is with @NgModule . I've tried with: * ``` * @NgModule Seems that html entitites works well outside code (```), but not inside code block (it does something weird like making

jsdoc @ character inside code block

北战南征 提交于 2021-01-22 04:53:38
问题 I'm trying to write documentation for a Module function like this: /** * Usage: * * ``` * @NgModule({ * imports: [ * BrowserModule, * ..., * ThisModule.forRoot({ * name: 'Name', * version: '1.0', * ], * }), * ``` * * @param config Service configuration parameters */ public static forRoot(config: SVConfig) { The problem is with @NgModule . I've tried with: * ``` * @NgModule Seems that html entitites works well outside code (```), but not inside code block (it does something weird like making

jsdoc @ character inside code block

那年仲夏 提交于 2021-01-22 04:53:31
问题 I'm trying to write documentation for a Module function like this: /** * Usage: * * ``` * @NgModule({ * imports: [ * BrowserModule, * ..., * ThisModule.forRoot({ * name: 'Name', * version: '1.0', * ], * }), * ``` * * @param config Service configuration parameters */ public static forRoot(config: SVConfig) { The problem is with @NgModule . I've tried with: * ``` * @NgModule Seems that html entitites works well outside code (```), but not inside code block (it does something weird like making

jsdoc and vscode: Documenting a function passed as an argument to another function

谁说胖子不能爱 提交于 2020-12-31 05:40:55
问题 I'm trying to document the input parameters to a function in javascript, but I can't work out how to do it in jsdoc. I've looked at the jsdoc documentation which suggests that using the @callback comment is what's required, but Visual Studio Code (vscode) doesn't highlight it as per the screenshot. The intellisense for the location parameter shows that it's type any rather than of type locator (a function with a parameter of id which returns a Location ). Example code which shows a function