for-ais-only/render_hook_docs/HIERARCHY_FORMAT.md
This document describes the YAML-based format for representing hierarchies (class inheritance, filesystem trees, etc.) in Redis documentation.
Hierarchies are written in YAML format within a code block with the language identifier hierarchy. The render hook preserves the YAML source for AI agents while JavaScript generates a visual diagram for users.
Parent:
Child1:
Child2:
Grandchild1:
Grandchild2:
This represents:
Parent
├── Child1
├── Child2
│ ├── Grandchild1
│ └── Grandchild2
Use quotes for names containing special characters (spaces, punctuation, etc.):
"Top-level folder":
"file1.js":
"file2.png":
"Inner folder":
"file3.jpg":
This is especially important for:
.js, .png, etc.)Add metadata to any item using the special _meta key:
"Exception":
_meta:
description: "Base exception class"
"RuntimeException":
"IOException":
Currently supported metadata fields:
description: A brief description of the item (displayed as italic text after the item name)link: URL or relative path to make the item clickable (works in both SVG diagrams and AI agent processing)ellipsis: Boolean indicating this is a placeholder for omitted itemsAdd a link field to make items clickable:
"Documentation":
_meta:
link: "https://example.com/docs"
"Getting Started":
_meta:
link: "./getting-started.md"
"API Reference":
_meta:
link: "./api-reference.md"
The link field:
description for additional contextUse an ellipsis item to indicate that some items are not shown:
"RedisError":
"ConnectionError":
"ResponseError":
"InvalidResponse":
"...":
_meta:
ellipsis: true
description: "Other exception types"
The _meta with ellipsis: true tells the renderer to display this as "..." and not expand it further. The ellipsis item is rendered with a dotted vertical line below it to indicate continuation. You can optionally add a description to provide context about the omitted items.
"RedisError":
_meta:
description: "Base class for all redis-py exceptions"
"ConnectionError":
_meta:
description: "Connection-related errors"
"TimeoutError":
"BusyLoadingError":
"ResponseError":
"InvalidResponse":
"DataError":
"PubSubError":
"...":
_meta:
ellipsis: true
description: "Other exception types"
This represents an exception hierarchy with:
"(root)":
"config.yaml":
_meta:
description: "Main configuration file"
"jobs":
_meta:
description: "Folder containing job definitions"
"default-job.yaml":
_meta:
description: "Default job configuration"
"job1.yaml":
"...":
_meta:
ellipsis: true
description: "Other job files"
This represents a filesystem structure with:
When type="filesystem" is used, the renderer displays file and folder icons next to each item.
```hierarchy {type="filesystem"}
Parent:
Child1:
Child2:
```
type (optional): Indicates the kind of hierarchy. Common values:
type="exception" - Exception/error hierarchytype="filesystem" - Filesystem or directory structuretype="generic" - Generic hierarchy (default if omitted)The type helps the renderer apply appropriate styling and helps AI agents understand the context.
noicons (optional): Disables icon rendering for filesystem hierarchies. Use noicons="true" to hide file/folder icons.
type="filesystem"Place the hierarchy code block where you want the diagram to appear in the rendered HTML. The render hook will:
<pre> element (for AI agents)| Field | Type | Purpose | Example |
|---|---|---|---|
description | string | Brief description of the item (displayed as italic text) | "Base exception class" |
link | string | URL or relative path to make the item clickable | "./api-reference.md" or "https://example.com" |
ellipsis | boolean | Marks as placeholder for omitted items | true |
description field is displayed as italic text after the item name in the rendered diagramlink field makes items clickable in SVG diagrams and provides navigation for AI agentsellipsis field should be set to true for items representing omitted content (typically named "...")description + link)The render hook generates a visual SVG diagram with:
type="filesystem")AI agents accessing the .html.md version see the raw YAML:
The YAML must be valid according to the YAML 1.2 specification:
Invalid YAML will cause rendering errors. Use a YAML validator to check your syntax.
See the following files for real-world examples:
content/develop/clients/redis-py/error-handling.md - Exception hierarchy with descriptionscontent/integrate/redis-data-integration/data-pipelines/_index.md - Filesystem hierarchy with file/folder icons