JSDoc to Markdown Converter
Convert JSDoc comments to clean Markdown documentation for GitHub README, Wiki, or Flatdoc. Supports @param, @returns, @constructor, and access filters.
Output will appear here after conversion...
About
Maintaining API documentation by hand introduces drift between code and docs. JSDoc comment blocks follow a strict grammar defined by the JSDoc 3 specification: a description line, followed by block tags like @param, @returns, and @constructor. This tool parses those blocks, associates each with its immediately following declaration (function, class, or variable), and emits structured Markdown with parameter tables, return types, and access badges. It handles nested parameter notation such as options.prop by indenting sub-parameters under their parent row. Filtering modes replicate the CLI flags --only-public (emit only blocks bearing an explicit @public tag) and --exclude-private (suppress blocks marked @private). Note: the parser assumes well-formed JSDoc 3 syntax. Malformed blocks (missing closing */, orphan tags outside comment blocks) are silently skipped rather than producing corrupt output.
Formulas
The converter operates as a three-stage pipeline: Extract → Parse → Render.
Each Block is a tuple of the raw comment text and the declaration line immediately following it. Extraction uses the regular expression pattern:
The parser then splits each block into lines, strips leading asterisks, and classifies each line as either a tag line or a continuation of the previous description. Tag lines match:
Filtering logic applies a predicate F over the parsed tag set T of each block:
Where T is the set of all tag names extracted from a given comment block, and @public and @private are string literals matched by exact equality. The renderer maps each parsed structure to its Markdown equivalent: function names become ## headings, parameters become pipe-delimited table rows with columns for Name, Type, and Description, and nested params (containing a dot separator) are indented with a non-breaking space prefix in the Name column.
Reference Data
| Tag | Syntax | Markdown Output | Notes |
|---|---|---|---|
| @param | @param {type} name desc | Row in Parameters table | Supports name.sub nesting |
| @returns | @returns {type} desc | Returns: line | Alias @return also accepted |
| @constructor | @constructor | Badge: Constructor | No value expected |
| @public | @public | Badge: Public | Used by only-public filter |
| @private | @private | Badge: Private | Used by exclude-private filter |
| @type | @type {type} | Type: line | For variable declarations |
| @typedef | @typedef {type} Name | Heading with type note | Custom type definition |
| @callback | @callback Name | Heading as callback | Followed by @param tags |
| @throws | @throws {type} desc | Throws: line | Alias @exception |
| @example | @example + code lines | Fenced code block | All lines until next tag or end |
| @deprecated | @deprecated reason | Deprecation warning | Renders as blockquote |
| @see | @see reference | See: link/text | Multiple allowed |
| @since | @since version | Since: version | Semantic version string |
| @version | @version version | Version: string | Applied to module/class |
| @author | @author name | Author: name | Multiple allowed |
| @license | @license identifier | License: string | SPDX identifier preferred |
| @module | @module name | Module heading | Top-level grouping |
| @namespace | @namespace name | Namespace heading | Object literal grouping |
| @memberof | @memberof parent | Scoped under parent | Prefix with parent name |
| @static | @static | Badge: Static | Class-level method |
| @abstract | @abstract | Badge: Abstract | Must be overridden |
| @async | @async | Badge: Async | Returns Promise |
| @fires | @fires EventName | Fires: event | Event emission |
| @listens | @listens EventName | Listens: event | Event subscription |
| @emits | @emits EventName | Emits: event | Alias for @fires |
| @default | @default value | Default: value | Property default |
| @readonly | @readonly | Badge: Read Only | Immutable property |
| @override | @override | Badge: Override | Overrides parent method |
| @enum | @enum {type} | Enum heading with type | Enumeration definition |
Frequently Asked Questions
{type} - description. @throws (alias @exception) renders similarly but prefixed with Throws. Multiple @throws tags produce multiple lines, reflecting that a function may throw different exception types under different conditions.