Documentation Front Matter
Every Markdown file under docs/ starts with a YAML front-matter block. It
records what the document covers (description, type, tags,
keywords), the files it describes and the tests that pin them (sources,
tests), and the other documents whose features interact with it
(related). The block makes the docs searchable by topic and by file, and
ties each document to the code it has to stay in sync with.
The docs site (dist/docs/) strips the block before rendering
(splitFrontMatter() in build.js), so it never appears on a rendered page.
GitHub shows it as a small table above the document.
Example
The shape of a block, with placeholders where a real document names its own files (shown indented here so the searches below don't match this page):
---
description: One sentence on what the document covers.
type: implementation
tags: [columns, persistence]
keywords: [someMethod(), some-attribute, a synonym readers search for]
sources:
- src/vanilla-grid/features/<feature>.feature.js
tests:
- tests/node/<feature>.test.js
- tests/playwright/<feature>.spec.js
related:
- docs/vanilla-grid/<other-document>.md
---
# Document Title
Fields
Keys appear in this order. An optional key is left out when it has no entries, never written with an empty value.
| Field | Required | Value | Meaning |
|---|---|---|---|
description |
yes | One line of plain text, at most 200 characters. | What the document covers, in one sentence. Read together, the descriptions are a catalog of the docs. |
type |
yes | One of the document types. | What kind of document it is. |
tags |
yes | Flow list of 1 to 8 tags from the tag vocabulary, primary topic first. | The topics the document covers in a section of its own, not the ones it only mentions. |
keywords |
no | Flow list of free-form terms. | Search terms that aren't tags: public API names (methods, options, attributes, events, CSS custom properties) and the words a reader might search for instead of the document's own ("pin" for freeze, "i18n" for localization). |
sources |
no | Block list of paths, sorted. | The files whose behavior the document describes: component source, plus build or test infrastructure for the repo-wide documents. A component's 00-index.md lists the component folder itself. |
tests |
no | Block list of paths under tests/, sorted. |
The tests that pin the behavior the document describes. |
related |
no | Block list of paths under docs/, sorted. |
The documents whose features interact with this one. Links are symmetric: when A lists B, B lists A. |
Format rules
The block is a strict subset of YAML, so any YAML parser reads it the same
way, and one line of grep output answers one question:
- The file's first line is
---, and a second---line closes the block. - One
key: valueper line, in the order above. No comments, blank lines, quotes or multi-line values. tagsandkeywordsare flow lists on one line:tags: [sorting, web-workers].sources,testsandrelatedare block lists, one- pathper line (two spaces, a dash, a space), sorted by plain string comparison.- Paths are relative to the repository root, use
/, and must exist. A folder ends with/. - No value contains
#, or a:followed by a space. No list item contains,[]{}or:. No value starts with a YAML indicator character (`'"[]{}&*!|>%@?:,, or-followed by a space), and no list item is a baretrue,false,null,yes,no,on,off,y,n,~or number.
Document types
| Type | Use for |
|---|---|
guide |
How to use or integrate a component, written for host-app developers. |
implementation |
How a feature works inside a component, written for maintainers: design, internals and contracts. |
index |
A component's entry document (00-index.md): reading order, module map, cross-component notes. |
reference |
Repo-wide material read on demand rather than tied to one feature: conventions, catalogs, measurements. |
Tag vocabulary
tests/node/docs-front-matter.test.js reads this table. A document can only
use a tag listed here, and every tag listed here must be used by at least one
document. Reuse a tag before adding one; add one for a topic that is the main
subject of a document or that two or more documents cover.
| Tag | Use for |
|---|---|
accessibility |
ARIA semantics, focus management and screen-reader behavior. |
aggregates |
Group aggregate reducers and group footer rows. |
architecture |
Module layout, lifecycle, initialization order and the contracts between a component's parts. |
auto-layout |
The diagram's automatic layouts: layout(), the layered and the tree layouts, Tidy up. |
build |
What build.js does: bundles, minify and obfuscation profiles, cache-bust injection, the docs site. |
clipboard |
The diagram's copy, cut, paste and duplicate: the clipboard format, the clipboard events and the API. |
column-freezing |
Freezing (pinning) columns to the left edge. |
column-reordering |
Moving columns by drag-and-drop, touch hold or API. |
column-resizing |
Column width resizing, auto-fit and stretch-to-fit. |
column-visibility |
Hiding and showing columns. |
columns |
Column definitions and column-state management. |
command-columns |
Per-row command button columns. |
connectors |
The diagram's ports, connectors and their routing. |
containers |
The diagram's containers: nodes that hold other nodes through their parent, the frames layer, moving, joining and removing with descendants. |
css |
Stylesheet structure, class names and CSS custom properties. |
data-loading |
Fetch lifecycle, paging and infinite scroll, total row count, cancellation and loading states. |
data-manager |
The data manager contracts (the grid's DataManager, the Gantt's and the diagram's) and the built-in OData, GraphQL and static managers. |
data-types |
Column value types: date, datetime and time parsing, number and boolean coercion. |
dependencies |
The Gantt's dependency links: resolving, indexing, routing and drawing them. |
documentation |
How these documents are written and maintained. |
events |
CustomEvent names, payloads and dispatch rules. |
excel-export |
The .xlsx export: writer, worker, delivery and styling. |
filtering |
Column filters: the filter model, operators, the filter panel, client and server evaluation. |
formatting |
Display formatting of numbers, dates and indicators. |
framework-integration |
Using the components from Vue, React, Angular or other renderers. |
getting-started |
Step-by-step guides for a first use of a component, with live examples. |
grouping |
Multi-level row grouping, caption rows and the group bar. |
header-menu |
The column header context menu, its submenus and the panels it opens. |
image-export |
The diagram's export as a picture: toSVG(), toPNG(). |
keyboard |
Keyboard input handling and keyboard navigation. |
localization |
Locales, message dictionaries and translated UI text. |
pan-and-zoom |
The diagram's viewport transform: wheel, trackpad and pinch zoom, panning, zoom to fit. |
performance |
Performance techniques, budgets and measurements. |
persistence |
Saved user settings: storage providers, keys and formats. |
pointer-input |
Pointer-event drag interactions (mouse, pen and touch): resizing, reordering and drag state. |
rendering |
Header and row markup, the render pass, cell rendering, empty, loading and error states. |
row-keys |
Stable row identity: key resolution strategies and duplicate keys. |
script-loading |
Runtime auto-loading of scripts, bundles, readiness promises and load order. |
scrolling |
Custom scrollbars, wheel, touch and keyboard scroll input, momentum and the scroll indicator. |
search |
Free-text search, search fields, the search index and its workers, match highlighting. |
selection |
Row selection modes, select-all, selection state and events; the diagram's selection of nodes and connectors. |
sorting |
Sort state, comparators, multi-column and server-side sorting. |
symbols |
The diagram's symbol definitions, symbol sets and the palette. |
testing |
Test suites, coverage and test-writing conventions. |
text-editing |
Text edited in place: the diagram's editor on node text and connector labels. |
theming |
Themes, theme tokens and runtime theme switching. |
timeline |
The Gantt's timeline: scale and zoom levels, header ticks, the lanes that follow the task grid. |
toolbar |
Command bars bound to a component: the grid toolbar, the Gantt toolbar, the diagram toolbar. |
touch |
Touch and mobile behavior: gestures, long-press, momentum and iOS hardening. |
tree |
Tree rows: parent keys, the depth-first projection, expand and collapse. |
typescript |
The hand-authored .d.ts declarations and their checks. |
undo-redo |
The diagram's commands, the undo and redo history and transactions. |
virtualization |
The virtual row pool, viewport sizing math and the scaled mode for very large datasets; the diagram's culling to what is in view. |
web-component |
Custom-element registration, observed attributes, lifecycle callbacks, property and method forwarding. |
web-workers |
Work moved off the main thread: sorting, filtering and search, export. |
Searching
Run these from the repository root.
The docs that describe a file, through their sources or tests entries or a
mention in the text (search by the file's name, which also matches a relative
link to it):
grep -rl "<file name>" docs/
The docs on a topic, by tag or keyword:
grep -rlE "^(tags|keywords):.*freez" docs/
A one-line catalog of every document:
grep -r "^description:" docs/
The documents of one type:
grep -rl "^type: guide" docs/
The documents related to one document are its related list. Links are
symmetric, so the list also names every document that links to it.
Keeping it current
The front matter changes in the same change as the document or the code it describes:
- A new document gets a complete block.
- When a source or test file is added, renamed, moved or deleted, every
sourcesandtestsentry naming it changes with it, and a new file is listed by the document that describes it. - When a document is renamed or deleted, every
relatedlist naming it changes, on both sides. - When a document's content changes, its
description,tags,keywordsandrelatedare checked against the new content.
tests/node/docs-front-matter.test.js (part of npm test) checks the format,
the field values, the tag vocabulary, that every path exists, and that
related links are symmetric. It can't tell whether the metadata is
accurate; review that like the rest of the document.