Skip to content
compodocx
Skip to article content

Guide 05

Comments

cngxjs (opens in new tab)Updated Guide05of 13

Use plainJSDoc-style block comments (opens in new tab). Markdown is rendered in descriptions: lists, fenced code, tables, links, headings. Multi-paragraph descriptions are preserved.

ts
/**
 * Renders a card with optional selection state.
 *
 * Use `as="link"` for a navigation-only card.
 *
 * | Mode    | Use case                  |
 * |---------|---------------------------|
 * | article | static content card       |
 * | button  | clickable action card     |
 * | link    | navigation card           |
 */
@Component({ ... })
export class CardComponent { ... }

The block above the class header becomes the entity description on the rendered page. Member-level comments (properties, methods, accessors, host listeners) render inline on each member card.

Fenced code in descriptions

Fenced code blocks in descriptions are syntax-highlighted with Shiki, picking the same theme pair your project is using. The default highlight language for description-level@example blocks is HTML. Assert against identifier text rather than the language class when writing custom downstream tooling.

Inline cross-references

Reference another symbol with {@link}. Resolution is project-wide and runs across additional pages too.

ts
/**
 * See {@link Button} for the button-only variant.
 *
 * @see {@link Card.Header}
 */

Additional pages

Markdown files outside the source tree can be wired in via asummary.json manifest. A node’s optionalslug keeps its URL stable when the wording changes, andaliases keep old URLs working. Missing files surface a per-page warning rather than failing the build, and nodes deeper than five levels are skipped. Relative links between Markdown files point at the generated pages, and {@link} works inside additional-page markdown identically to source comments.

Markdown layout hints

Two conventions change how compodocx lays out Markdown in additional pages, the README and the other root files, and feature READMEs. JSDoc comments and READMEs next to source files keep the plain layout. Both render as plain Markdown on GitHub and npm.

Lead-ins. A paragraph or list item that starts with a short bold label ending in a period or a colon gets the label in its own column once the page is wide enough; on narrow screens the label sits above the text. The label must come first, be plain text (no code or links inside the bold) and be at most 40 characters long.

md
**Parts.** The header stays fixed while the rest of the panel scrolls.

**Modality.** Sheet and fullscreen are both modal.

- **Focus.** Focus moves into the panel when it opens.
- **Close vectors.** Escape, a tap outside the panel and the back gesture close it.

Inline lists. An HTML comment<!-- compodocx: inline --> directly before a bullet list renders that list as a row of chips, for short items such as browser versions or tags. Only the list right after the comment is affected; numbered lists are left alone. Everything else gets one base style; compodocx does not guess a layout from the content of a list.

md
<!-- compodocx: inline -->
- Chrome 125+
- Firefox 131+
- Safari 18.4+

Provenance marker

Flag a markdown file as AI-assisted with an HTML-comment marker on its first line. Detected on additional pages and READMEs. Renders a localized chip and sentence above the content. An optional value (model name, date, or key=value pairs) shows in the sentence.--hideAiGeneratedBadge hides it. For the source-symbol equivalent see the @aiGenerated JSDoc tag in theJSDoc Tags guide.

md
<!-- @aiGenerated -->
<!-- @aiGenerated model=example-model date=2026-05 -->
<!-- @aiGenerated 2026-05 -->

# Component guide

The marker must be the first line of the file.