Skip to content

Commit 4b30e75

Browse files
committed
Update README
1 parent 7face7e commit 4b30e75

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ An extension for Visual Studio Code and compatible IDEs that provides autocomple
2424
- **Mutation preview**: See step-by-step transformation results when hovering over variables with mutations.
2525
- **Enhanced completion tooltips**: Get full variable values when selecting from autocompletion.
2626
- **Syntax highlighting**: Enhanced syntax highlighting for directives, parameters, roles, substitution variables, and mutation operators that works alongside standard Markdown highlighting.
27+
- **Built-in versions**: Automatically fetches and caches version substitutions from the docs-builder repository, available as `{{version.*}}` variables with autocompletion support.
2728

2829
## Inline roles
2930

@@ -114,6 +115,23 @@ sub:
114115

115116
These merge with `docset.yml` substitutions and are available throughout the document.
116117

118+
### Built-in versions from docs-builder
119+
120+
The extension automatically fetches version substitutions from the [docs-builder repository](https://github.com/elastic/docs-builder) and makes them available as `{{version.*}}` variables. These versions are cached locally and refreshed automatically every hour, ensuring you always have access to the latest version information.
121+
122+
**Available version variables:**
123+
- Type `{{version.` to see all available version substitutions (e.g., `{{version.edot_php}}`, `{{version.stack}}`, `{{version.self}}`)
124+
- Versions are automatically loaded when the extension activates
125+
- The cache is refreshed automatically every hour in the background
126+
127+
**Manual refresh:**
128+
If you need to refresh the versions cache manually:
129+
1. Press `Ctrl/Cmd+Shift+P` to open the Command Palette
130+
2. Run **Elastic Docs: Refresh Versions Cache**
131+
3. The extension will fetch the latest versions from GitHub and update the cache
132+
133+
The versions are sourced from the `versions.yml` file in the docs-builder repository and include all versioning systems defined there, such as stack versions, product-specific versions, and more.
134+
117135
### Substitution validation and quick fixes
118136

119137
The extension automatically detects when you're using literal values that can be replaced with substitution variables. For example, if you have a substitution variable `{{product.apm}}` defined in your `docset.yml` file with the value "APM", the extension shows a warning when you type "APM" directly in your content, suggesting you use `{{product.apm}}` instead.
@@ -134,13 +152,15 @@ This helps maintain consistency across your documentation and makes it easier to
134152
3. **Try the features**:
135153
- Type `:::` to see directive completions
136154
- Type `{icon}` followed by a backtick to see icon options
137-
- Type `{{` to see substitution variables
155+
- Type `{{` to see substitution variables (including built-in versions from docs-builder)
156+
- Type `{{version.` to see available version substitutions
138157
- Type `|` after a variable to see mutation operators
139158
- Use `.elasticsearch` shorthand for `product.elasticsearch`
140159
- Add `sub:` field in frontmatter for document-specific variables
141160
- Add frontmatter fields and see autocompletion
142161
- Notice validation warnings for literal values that could use substitutions
143162
- Hover over variables with mutations to see transformation previews
163+
- Use the Command Palette to manually refresh versions cache if needed
144164

145165
## Installation
146166

0 commit comments

Comments
 (0)