IF Commons GitHub

tsdoc

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0001-docs FR-001

TSDoc read into its parts (commons 0011-documentation FR-006): the summary, @remarks, @limits (this repository's own block tag: what a module does not do, or does only in part), @example, @see, @param, @returns and @deprecated, from a comment's text or from the tags the TypeScript checker gives. The text of each part stays Markdown, for markdown.ts to read.

import { moduleComment } from "./tsdoc.ts";
moduleComment("/**\n * What it is.\n *\n * @limits\n * What it is not.\n *\n * @module\n *\/\n")?.limits; // "What it is not."

Source: commons/docs/src/tsdoc.ts

1 of 2 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

DocCommentinterfaceno test imports it
interface DocComment

The parts of a TSDoc comment.

MemberTypeWhat it is
summarystringWhat comes before the first block tag.
remarks?string@remarks: the longer account.
limits?string@limits: what it does not do, or does only in part.
examplesreadonly string[]Each @example.
seereadonly string[]Each @see.
paramsreadonly DocParam[]Each @param.
returns?string@returns.
deprecated?string@deprecated, with why.
isModulebooleanWhether it says @module.
moduleCommentfunction
function moduleComment(source: string): DocComment | undefined

The module comment of a source file: its first /** ... *\/ comment (after any // lines, such as a // Spec: header), where that comment says @module.

ParameterWhat it is
sourcethe file's text

Imported by 2 tests of the run (2 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.