Skip to content

Commit

Permalink
Added support for '--clever-links' and '--monospace-links' options. M…
Browse files Browse the repository at this point in the history
…erges PR #302
  • Loading branch information
75lb committed Aug 29, 2024
1 parent 4c73344 commit fbb2375
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 13 deletions.
3 changes: 3 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Returns markdown documentation from jsdoc-annoted source code.
| [options.param-list-format] | | Two options to render parameter lists: 'list' or 'table' (default). Table format works well in most cases but switch to list if things begin to look crowded / squashed. |
| [options.property-list-format] | | list, table. |
| [options.member-index-format] | | grouped, list |
| [options.clever-links] | <code>boolean</code> | If true, then implements jsdoc 'cleverLinks' algorithm; `{@link}` tags captions with a URL link are rendered in plain text and captions with non-URL links are rendered in monospace. |
| [options.monospace-links] | <code>boolean</code> | If true, then `{@link}` tags are rendered in monospace. This option is ignored if `clever-links` is true. |

**Example**
Pass in filepaths (`**` glob matching supported) of javascript source files:
Expand Down Expand Up @@ -145,3 +147,4 @@ Sync version of [getJsdocData](#module_jsdoc-to-markdown--JsdocToMarkdown+getJsd
| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>object</code> | Identical options to [getJsdocData](#module_jsdoc-to-markdown--JsdocToMarkdown+getJsdocData). |

2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class JsdocToMarkdown {
* @param [options.param-list-format] {} - Two options to render parameter lists: 'list' or 'table' (default). Table format works well in most cases but switch to list if things begin to look crowded / squashed.
* @param [options.property-list-format] {} - list, table.
* @param [options.member-index-format] {} - grouped, list
* @param [options.clever-links] {boolean} - If true, then implements jsdoc 'cleverLinks' algorithm; `{@link}` tags captions with a URL link are rendered in plain text and captions with non-URL links are rendered in monospace.
* @param [options.monospace-links] {boolean} - If true, then `{@link}` tags are rendered in monospace. This option is ignored if `clever-links` is true.
* @return {Promise}
* @fulfil {string} - the rendered docs
* @category async
Expand Down
10 changes: 10 additions & 0 deletions lib/cli-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,16 @@ const dmdDefinitions = [
name: 'member-index-format',
type: String,
description: 'Two options to render member lists: [bold]{list} or [bold]{grouped} (default). The [bold]{list} view is loosely-based on the nodejs docs.'
},
{
name: 'clever-links',
type: Boolean,
description: 'If true, [bold]{{@link XXX}} tags are rendered in normal text if XXX is a URL and monospace (code) format otherwise.'
},
{
name: 'monospace-links',
type: Boolean,
description: 'If true, all [bold]{{@link}} tags are rendered in monospace (code) format. This setting is ignored in [bold]{--clever-links} is true.'
}
]

Expand Down
36 changes: 23 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fbb2375

Please sign in to comment.