Comments (1)
The readme explains how to write compatible JSDoc comments. See:
Missing JSDoc tags are not inferred by inspecting the code, so be sure to use all the necessary tags.
— https://github.com/jaydenseric/jsdoc-md/tree/v11.0.2#no-code-inference
Over the years I noticed that one of the biggest frustrations with using tools that generate API docs from source JSDoc is that they often have bugs about reading the code the JSDoc comment is associated with to infer particular details about the member being documented (especially the kind and name). They have bugs because they make a complicated mess of parsing the code, traversing the AST, etc. Also, when new ES syntax is added to the language these tools always took a very long time to update to understand it and not crash horribly or miss information.
It is a goal of jsdoc-md
is to purely look at the JSDoc comments to generate the API docs, so it's very reliable and predictable. At a minimum, each JSDoc comment (that you want to appear in the generated API docs) should have these tags:
For a few kinds, there are shorthand tags that combine the kind and name into one tag:
This is useful for when you need to support tools like TypeScript that don't understand the separated name and kind tags.
You can then use additional supported tags to flesh out the details relevant to the kind:
https://github.com/jaydenseric/jsdoc-md/tree/v11.0.2#tag-subset
Unsupported tags not in that list are still safe to use for other tooling, they just get ignored by jsdoc-md
.
Here are the necessary changes to make to achieve compatibility:
/**
+ * @kind constant
+ * @name test
* @type {Number}
*/
const test = 0
/**
+ * @kind function
+ * @name test2
* @param {Number} lol - oh no...
*
* @returns {0}
*/
function test2(lol) { return 0 }
I'm currently in the process of migrating from Node.js to Deno, which has an evolving built-in system for scanning code and JSDoc to generate API docs. I'm waiting for it to stabilize a bit before I figure out if it can be used on it's own in my future Deno related or even Node.js related projects or if it can be used as part of a new Deno alternative to jsdoc-md
. One of the things that will probably change in my future tooling is I will align to the Deno flavor of TypeScript JSDoc and might leverage code inference, since the smarts to do so will be part of the platform and much more reliable.
from jsdoc-md.
Related Issues (17)
- how do we show type for namespace? HOT 2
- We should extend the MDN link types. HOT 1
- Make auto MDN linking ES global types case-sensitive HOT 5
- Missing target heading “API”. HOT 2
- Display source code file path and location in inline @link tag namepath related error messages
- Code location in inline @link tag namepath error messages doesn't account for JSDoc comment fence
- Generate “Fired by” content for events
- CLI to check if the markdown file is up to date HOT 1
- Publish the private JSDoc analysis API HOT 3
- Getting ERR_PACKAGE_PATH_NOT_EXPORTED HOT 4
- Errors when used in a repl.it environment HOT 8
- Support JSDoc inline links HOT 2
- Fix broken successive member links
- @returns documentation not generated
- Sort members in the documentation outline HOT 1
- We should support Uint8Array? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsdoc-md.