You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this directory is the main pipeline that converts our content from Liquid, Markdown and YAML into HTML. This directory _does not include React components_.
3
+
The content-render subject is the main pipeline that converts content from Liquid, Markdown, and YAML into HTML. It handles template processing, Markdown parsing, custom Liquid tags, and unified (remark/rehype) transformations. This directory does not include React components.
4
4
5
-
## Usage
5
+
## Purpose & Scope
6
+
7
+
This subject is responsible for:
8
+
- Rendering Liquid templates with context variables
9
+
- Converting Markdown to HTML with unified (remark/rehype)
10
+
- Custom Liquid tags for content and data references
11
+
- Code block syntax highlighting and headers
12
+
- Link rewriting (local paths, assets, anchors)
13
+
- Image transformations and wrapping
14
+
- Alert/note callout rendering
15
+
- Table accessibility improvements
16
+
- Text-only extraction for search indexing
17
+
18
+
## Architecture & Key Assets
19
+
20
+
### Key capabilities and their locations
21
+
22
+
-`index.ts` - `renderContent()`: Main entry point for content rendering
23
+
-`liquid/engine.ts` - Liquid engine with custom tag registration
24
+
-`unified/processor.ts` - Unified pipeline with remark/rehype plugins
-[Content style guide](../../contributing/) - Using Liquid tags in content
70
111
71
-
```html
72
-
{% data variables.product.product_name %}
73
-
```
112
+
### Ownership
113
+
- Team: Docs Engineering
74
114
75
-
## Supported tags
115
+
## Current State & Next Steps
76
116
77
-
| Markup | Renders |
78
-
| -- | -- |
79
-
| `{% indented_data_reference foo.bar spaces=NUMBER %}` | A data reference with the specified number of spaces prepended to each line. Defaults to 2 spaces if no spaces included. For example: `{% indented_data_reference reusables.pages.wildcard-dns-warning spaces=3 %}`
117
+
### Supported Liquid tags
80
118
81
-
## Creating tags
119
+
Custom tags implemented:
82
120
83
-
Each custom tag has the following:
121
+
| Tag | Purpose |
122
+
|-----|---------|
123
+
|`{% data variables.product.product_name %}`| Access data variables |
124
+
|`{% ifversion fpt %}...{% endif %}`| Conditional content by version |
125
+
|`{% octicon "check" %}`| Render Octicons |
126
+
|`{% indented_data_reference foo.bar spaces=2 %}`| Data reference with indentation |
127
+
|`{% tool name %}`| Tool-specific content |
128
+
|`{% prompt %}`| Command prompt styling |
84
129
85
-
- a JavaScript class in `lib/liquid-tags/`
86
-
- an HTML template in `includes/liquid-tags/`
130
+
See [contributing/liquid-helpers.md](../../contributing/liquid-helpers.md) for complete list.
87
131
88
-
The class and the template should have corresponding names, like `lib/liquid-tags/my-tag.ts` and `includes/liquid-tags/my-tag.html`
132
+
### Using tags
133
+
134
+
Tags can be used in:
135
+
- Articles and TOCs (`content/**/*.md`)
136
+
- Include files (`includes/*.html`)
89
137
90
-
You must also register the new tag in `src/content-render/liquid/engine.ts` with a line like this:
138
+
Tags expect language-agnostic hrefs or data paths:
0 commit comments