|
1 | 1 | # Syntax guide |
2 | 2 |
|
3 | | -Elastic Docs V3 uses [Markdown](https://commonmark.org) as its main content authoring format. |
| 3 | +Learn about the custom Markdown syntax used in Elastic documentation. |
4 | 4 |
|
5 | | -:::{admonition} New to Elastic Docs V3? |
6 | | -* Learn [Markdown](https://commonmark.org/help/) in 10 minutes |
7 | | -* Review the V3 [](quick-ref.md) |
8 | | -::: |
| 5 | +## Quick reference |
9 | 6 |
|
10 | | -V3 fully supports [CommonMark](https://commonmark.org/), a strongly defined, standard-compliant Markdown specification. In many cases, plain Markdown syntax will be sufficient when authoring Elastic content. On top of this functionality, there are two main syntax extension points: |
| 7 | +Refer to the [quick reference](quick-ref.md) for a condensed syntax cheat sheet. |
11 | 8 |
|
12 | | -* [Directives](#directives) |
13 | | -* [GitHub-flavored markdown](#github-flavored-markdown) |
| 9 | +## How it works |
14 | 10 |
|
15 | | -## Available directives |
| 11 | +Elastic Docs V3 uses a custom implementation of [MyST](https://mystmd.org/) (Markedly Structured Text), which extends standard Markdown with directive syntax. |
16 | 12 |
|
17 | | -The following directives are available in Elastic Docs V3: |
| 13 | +If you know [Markdown](https://commonmark.org), you already know most of what you need. If not, the CommonMark project offers a [10-minute tutorial](https://commonmark.org/help/). |
18 | 14 |
|
19 | | -* [Admonitions](admonitions.md) - Callouts and warnings |
20 | | -* [Code blocks](code.md) - Syntax-highlighted code |
21 | | -* [CSV include](csv-include.md) - Render CSV files as tables |
22 | | -* [Diagrams](diagrams.md) - Visual diagrams and charts |
23 | | -* [Dropdowns](dropdowns.md) - Collapsible content |
24 | | -* [Images](images.md) - Enhanced image handling |
25 | | -* [Include](file_inclusion.md) - Include content from other files |
26 | | -* [Settings](automated_settings.md) - Configuration blocks |
27 | | -* [Stepper](stepper.md) - Step-by-step content |
28 | | -* [Tabs](tabs.md) - Tabbed content organization |
29 | | -* [Tables](tables.md) - Data tables |
30 | | -* [Version blocks](version-variables.md) - API version information |
| 15 | +When you need more than basic Markdown, you can use [directives](directives.md) to add features like callouts, tabs, and diagrams. |
31 | 16 |
|
32 | | -## Directives |
| 17 | +## GitHub Flavored Markdown support |
33 | 18 |
|
34 | | -Directives extend CommonMark functionality. Directives have the following syntax: |
| 19 | +V3 supports some GitHub Flavored Markdown extensions: |
35 | 20 |
|
36 | | -```markdown |
37 | | -:::{EXTENSION} ARGUMENTS |
38 | | -:OPTION: VALUE |
| 21 | +**Supported:** |
| 22 | +- Tables (basic pipe syntax) |
| 23 | +- Strikethrough with `~~text~~` (renders as ~~text~~) |
39 | 24 |
|
40 | | -Nested content that will be parsed as markdown |
41 | | -::: |
42 | | -``` |
43 | | - |
44 | | -- `EXTENSION` is the name of the directive. Names are always wrapped in brackets `{ }`. For example: [`{note}`](admonitions.md#note). |
45 | | -- `ARGUMENT` an optional main argument. For example: [`:::{include} _snippets/include.md :::`](file_inclusion.md) |
46 | | -- `:OPTION: VALUE` is used to further customize a given directive. |
47 | | - |
48 | | -Defining directives with `:::` allows the nested markdown syntax to be highlighted properly by editors and web viewers. |
49 | | - |
50 | | - |
51 | | - |
52 | | -### Nesting Directives |
53 | | - |
54 | | -Increase the number of leading semicolons to include nested directives. |
55 | | - |
56 | | -In the following example, a `{note}` wraps a `{hint}`: |
57 | | - |
58 | | -```markdown |
59 | | -::::{note} My note |
60 | | -:::{hint} My hint |
61 | | -Content displayed in the hint admonition |
62 | | -::: |
63 | | -Content displayed in the note admonition |
64 | | -:::: |
65 | | -``` |
66 | | - |
67 | | -## Literal directives |
68 | | - |
69 | | -All directive are indicated with semicolons except literal blocks. For these you need to use triple backticks. |
70 | | - |
71 | | -* [Code blocks](code.md) |
72 | | -* [{applies-to} blocks](applies.md) |
73 | | - |
74 | | -Since their contents **should not** be parsed as markdown they use backticks. This also ensures maximum interopability with existing markdown editors and previews. |
75 | | - |
76 | | -Many Markdown editors support syntax highlighting for embedded code blocks. For compatibility with this feature, use triple backticks instead of triple colons for content that needs to be displayed literally: |
77 | | - |
78 | | -````markdown |
79 | | -```js |
80 | | -const x = 1; |
81 | | -``` |
82 | | -```` |
83 | | - |
84 | | -## GitHub Flavored Markdown |
85 | | - |
86 | | -We support _some_ [GitHub Flavored Markdown (GFM) extensions](https://github.github.com/gfm/). |
87 | | - |
88 | | -### Supported |
89 | | - |
90 | | -* [](tables.md#basic-table) |
91 | | -* Strikethrough: ~~as seen here~~ |
92 | | - |
93 | | -### Not supported |
94 | | - |
95 | | -* Task lists |
96 | | -* Auto links (http://www.elastic.co) |
97 | | -* Using a subset of HTML |
| 25 | +**Not supported:** |
| 26 | +- Task lists |
| 27 | +- Automatic URL linking: https://www.elastic.co |
| 28 | + - Links must use standard Markdown syntax: [Elastic](https://www.elastic.co) |
| 29 | +- Using a subset of HTML |
0 commit comments