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
Copy file name to clipboardExpand all lines: website/README.md
+119Lines changed: 119 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -116,6 +116,125 @@ There are several custom markdown plugins that are available by default that enh
116
116
117
117
...while it perhaps would not be an improved user experience, no links would break because of it. The best approach is to **avoid changing headlines and inline code at the start of a list item**. If you must change one of these items, make sure to tag someone from the digital marketing development team on your pull request, they will help to ensure as much compatibility as possible.
118
118
119
+
### Custom Components
120
+
121
+
A number of custom [mdx components](https://mdxjs.com/) are available for use within any `.mdx` file. Each one is documented below:
122
+
123
+
#### Tabs
124
+
125
+
The `Tabs` component creates tabbed content of any type, but is often used for code examples given in different languages. Here's an example of how it looks from the Vagrant documentation website:
The intentionally skipped line is a limitation of the mdx parser which is being actively worked on. All tabs mst have a heading, and there is no limit to the number of tabs, though it is recommended to go for a maximum of three or four.
155
+
156
+
#### Enterprise Alert
157
+
158
+
This component provides a standard way to call out functionality as being present only in the enterprise version of the software. It can be presented in two contexts, inline or standalone. Here's an example of standalone usage from the Consul docs website:
The standalone component can be used as such in markdown files:
163
+
164
+
```mdx
165
+
# Page Headline
166
+
167
+
<EnterpriseAlert />
168
+
169
+
Continued markdown content...
170
+
```
171
+
172
+
It can also receive custom text contents if you need to change the messaging but wish to retain the style. This will replace the text `This feature is available in all versions of Consul Enterprise.` with whatever you add. For example:
173
+
174
+
```mdx
175
+
# Page Headline
176
+
177
+
<EnterpriseAlert>
178
+
My custom text here, and <ahref="#">a link</a>!
179
+
</EnterpriseAlert>
180
+
181
+
Continued markdown content...
182
+
```
183
+
184
+
It's important to note that once you are adding custom content, it must be html and can not be markdown, as demonstrated above with the link.
185
+
186
+
Now let's look at inline usage, here's an example:
And here's how it could be used in your markdown document:
191
+
192
+
```mdx
193
+
### Some Enterprise Feature <EnterpriseAlertinline />
194
+
195
+
Continued markdown content...
196
+
```
197
+
198
+
It's also worth noting that this component will automatically adjust to the correct product colors depending on the context.
199
+
200
+
#### Other Components
201
+
202
+
Other custom components can be made available on a per-site basis, the above are the standards. If you have questions about custom components that are not documented here, or have a request for a new custom component, please reach out to @hashicorp/digital-marketing.
203
+
204
+
### Syntax Highlighting
205
+
206
+
When using fenced code blocks, the recommendation is to tag the code block with a language so that it can be syntax highlighted. For example:
207
+
208
+
````
209
+
```
210
+
// BAD: Code block with no language tag
211
+
```
212
+
213
+
```javascript
214
+
// GOOD: Code block with a language tag
215
+
```
216
+
````
217
+
218
+
Check out the [supported languages list](https://prismjs.com/#supported-languages) for the syntax highlighter we use if you want to double check the language name.
219
+
220
+
It is also worth noting specifically that if you are using a code block that is an example of a terminal command, the correct language tag is `shell-session`. For example:
221
+
222
+
🚫**BAD**: Using `shell`, `sh`, `bash`, or `plaintext` to represent a terminal command
223
+
224
+
````
225
+
```shell
226
+
$ terraform apply
227
+
```
228
+
````
229
+
230
+
✅**GOOD**: Using `shell-session` to represent a terminal command
0 commit comments