Comprehensive writing guide for Angular documentation (adev). Covers Google Technical Writing standards, Angular-specific markdown extensions, code blocks, and components. You MUST use this skill any time you plan to create, edit, or review documentation files in `adev/` or `adev/src/content`.
This skill provides comprehensive guidelines for authoring content in adev/src/content. It combines Google's technical writing standards with Angular-specific markdown conventions, components, and best practices.
CONTRIBUTING.md or similar).Use the appropriate language identifier for syntax highlighting:
angular-ts when TypeScript code examples contain inline templates.angular-html for Angular templates.ts for plain TypeScript.html for plain HTML.shell or bash.mermaid fenced block. <docs-code language="mermaid"> is not supported and fails the build.You can enhance code blocks with attributes in curly braces {} after the language identifier. header and highlight take a value after a colon; the rest are bare flags, and writing one as flag: true fails the build with Invalid code block metadata, as does an unrecognized key:
header: "Title": Adds a title to the code block.linenums: Enables line numbering.highlight: [2]: Highlights specific lines. An ascending two-number array is a range, so [12, 19] highlights lines 12 through 19. One number, or three or more, is a literal list. Nest one level to mix the two: [[3,7], 9].hideCopy: Hides the copy button.hideDollar: Hides the $ prompt in shell examples.prefer: Marks code as a preferred example (green border/check).avoid: Marks code as an example to avoid (red border/cross).Example:
```angular-ts {header: "My Component", linenums, highlight: [2]}
@Component({
selector: 'my-app',
template: '<h1>Hello</h1>',
})
export class App {}
```<docs-code> ComponentFor more advanced code block features, use the <docs-code> component. Its attributes use HTML syntax, attr="value" with double quotes, and bare names for the boolean ones. It validates nothing, so an unrecognized attribute and a single-quoted value are both ignored without an error:
path: Path to a source file (e.g., adev/src/content/examples/...).header: Custom header text.language: Language identifier (e.g., angular-ts). When omitted, it is inferred from the file extension, and an extension it does not recognize falls back to angular-ts, so set it for shell, markdown and scss files.linenums: Boolean attribute.highlight: Array of line numbers/ranges, with the same semantics as the fenced form (e.g., [[3,7], 9]).visibleLines: Range of lines to show initially (collapsible).region: Region to extract from source file.preview: Boolean. Renders the example as a running component below the code. Only works with standalone examples.hideCode: Boolean. Collapses code by default.hideDollar: Hides the $ prompt in shell examples.prefer / avoid: Mark the example as preferred or as one to avoid.Multifile Example:
<docs-code-multifile path="..." preview>
<docs-code path="..." />
<docs-code path="..." />
</docs-code-multifile>Use specific keywords followed by a colon for alerts. These render as styled blocks.
NOTE: For ancillary information.TIP: For helpful hints or shortcuts.IMPORTANT: For crucial information.CRITICAL: For warnings about potential data loss or severe issues.TODO: For incomplete documentation.QUESTION: To pose a question to the reader.SUMMARY: For section summaries.TLDR: For concise summaries.HELPFUL: For best practices.Example:
TIP: Use `ng serve` to run your application locally.<docs-card>):
<docs-card-container>; a single card also renders on its own.title, href, link, imgSrc, iconImgSrc, titleInline.href is the destination and link only replaces the default "Learn more" label, so a URL written in link renders as text and a card without href is not clickable.<docs-callout>):
title, important, critical.<docs-pill>):
<docs-pill-row>.title, href.<docs-step>):
<docs-workflow>.title.<docs-tab>):
<docs-tab-group>.label.<docs-video>):
src (YouTube embed URL), title (names the video in the play link's label).Use standard markdown syntax with optional attributes for sizing and loading behavior.
#small, #medium: Append to image URL for sizing.{loading: 'lazy'}: Add attribute for lazy loading.Example:
#, ##, ###).h2 and h3 are most common for content structure.angular/angular
2af465b
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.