Skip to content

Page, category and API files

The fields of the three entity files: ng-doc.page.ts, ng-doc.category.ts and ng-doc.api.ts, and the front matter of Markdown files. Each entity file must default-export one object.

NgDocPage

The default export of ng-doc.page.ts. See NgDocPage and Pages and categories.

FieldTypeDefaultDescription
titlestringrequiredThe page title in the header and the sidebar.
mdFilestring | string[]requiredThe Markdown file, or several files shown as tabs. Paths are relative to the page.
categoryNgDocCategory–The category that contains the page.
ordernumber–The position in the sidebar, lowest first.
routestring | RouteThe folder nameThe route segment, or an Angular Route object. Use route.children for fullscreen demos.
hiddenbooleanfalseRemoves the page from the sidebar. The route still works.
onlyForTagsstring[]–Keeps the page only in builds with one of these tags. A build's tags default to its configuration name (Pages and categories [Build tags]). New engine only.
dataunknown–Any data, available in the page template as NgDocPage.data.
importsComponent['imports']–Angular imports for the page. Standalone demos don't need them.
providersComponent['providers']–Providers for every component on the page.
demosRecord<string, Type<unknown>>–Demo components, keyed by class name (Demos).
playgroundsRecord<string, NgDocPlaygroundConfig>–Playgrounds, keyed by playground ID (Playgrounds).
disableFullscreenRoutesbooleanfalseRenders child routes in your own router-outlet instead of as standalone pages.

A doc comment on the page object becomes the page description. A @status:<color> <text> tag in it adds a sidebar badge.

NgDocCategory

The default export of ng-doc.category.ts. See NgDocCategory.

FieldTypeDefaultDescription
titlestringrequiredThe category title in the sidebar and in breadcrumbs.
categoryNgDocCategory–The parent category.
ordernumber–The position in the sidebar, lowest first.
routestringThe folder nameThe route segment. Page routes start with it.
expandablebooleantrueLets readers collapse the category. When false, it is always open.
expandedbooleanfalseOpens the category when the site loads.
hiddenbooleanfalseRemoves the category and its pages from the sidebar.
onlyForTagsstring[]–Keeps the category, and everything in it, only in builds with one of these tags. New engine only.
providersRoute['providers']–Providers for every page in the category.

NgDocApi

The default export of ng-doc.api.ts. See NgDocApi and Generate API pages.

FieldTypeDefaultDescription
titlestringrequiredThe title of the API list page.
scopesNgDocApiScope[]requiredThe sources to document. Each scope is a group in the API list.
categoryNgDocCategory–The category that contains the API list page.
routestring'api'The route of the API list page. Use different routes for several API files.
keywordstring–A page keyword for the API list page, used as * followed by the keyword.
ordernumber–The position in the sidebar, lowest first.
hiddenbooleanfalseRemoves the API list page from the sidebar.

NgDocApiScope

FieldTypeDefaultDescription
namestringrequiredThe scope name shown in the API list, usually the package name.
routestringrequiredThe route segment of the scope's API pages.
includestring | string[]requiredGlob patterns of the files to document, relative to the workspace root.
excludestring | string[]–Glob patterns of the files to skip.
ordernumber–The position of the scope in the API list.

Every exported class, interface, function, type alias, enum and variable in the included files gets an API page. A declaration with an @internal tag is skipped.

Playground configuration

Each value in a page's playgrounds is an NgDocPlaygroundConfig. The options of NgDocActions.playground() can also be set here.

FieldTypeDefaultDescription
targetType<unknown>requiredThe component, directive or pipe to play with.
templatestringrequiredThe template. <ng-doc-selector> stands for the target's selector.
controlsRecord<string, string | NgDocPlaygroundControlConfig>–Extra or replacement controls, keyed by property name.
contentRecord<string, NgDocPlaygroundContent>–Content that readers can toggle, inserted into the template by key.
selectorsstring | string[]AllThe selectors to render, for targets with several selectors.
expandedbooleanfalseOpens the playground expanded.
hideSidePanelbooleanfalseHides the controls.
inspectorPosition'right' | 'bottom''right'Puts the controls right of the demos, or below them.
inputsRecord<string, unknown>–Input values set once when the playground renders.
defaultsRecord<string, unknown>–Initial control values, also used by the reset button.
hiddenInputsstring[]–Inputs without a control.
dataRecord<string, unknown>–Data for the template, available as data.

Markdown front matter

Front matter goes at the top of a Markdown file, between --- lines.

FieldDescription
keywordThe page keyword. Link to the page with * followed by the keyword.
titleThe tab label, for pages with several Markdown files. The page title is used by default.
routeThe tab route, added to the page route. Required on every tab except the first one.
iconThe tab icon.
nx.mdMarkdown
---
title: Nx
route: nx
keyword: InstallationNxPage
---
Edit this page