Skip to content

Commit 3189eff

Browse files
committed
add migration docs
1 parent 0d26198 commit 3189eff

File tree

2 files changed

+46
-125
lines changed

2 files changed

+46
-125
lines changed

docs/source/migration/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Adapted from the MDX migration guide: https://docs.elastic.dev/migration/syntax.
1212
* [Admonitions](syntax/admonitions.md)
1313
* [Tabs](syntax/tabs.md)
1414

15-
```{toctree}
15+
<!-- ```{toctree}
1616
:hidden:
1717
1818
syntax/admonitions.md
1919
syntax/tabs.md
20-
```
20+
``` -->
Lines changed: 44 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,70 @@
1+
12
---
2-
title: Admonitions
3+
title: Admonition Blocks
34
---
45

5-
This guide provides instructions for converting common AsciiDoc admonitions to MyST Markdown format.
6-
7-
## Admonition Mapping
8-
9-
| AsciiDoc | MyST Markdown |
10-
|--------------|----------------|
11-
| NOTE | `{note}` |
12-
| TIP | `{tip}` |
13-
| IMPORTANT | `{important}` |
14-
| WARNING | `{warning}` |
15-
| CAUTION | `{caution}` |
16-
| DANGER | `{danger}` |
17-
18-
### Example Conversion
19-
20-
In AsciiDoc:
21-
```text
22-
[NOTE]
23-
====
24-
This is a note.
25-
It can be multiple lines, but not multiple paragraphs.
26-
====
27-
```
28-
29-
In MyST Markdown:
30-
```
31-
:::{note}
32-
This is a note.
33-
It can be multiple lines, but not multiple paragraphs.
34-
:::
35-
```
36-
37-
:::{note}
38-
This is a note.
39-
It can be multiple lines, but not multiple paragraphs.
40-
:::
41-
42-
## Admonition Paragraphs
43-
44-
For single-paragraph admonitions, convert them directly to MyST admonition syntax using the appropriate admonition type. Use triple colons `:::` to open and close the block.
45-
46-
### Example
47-
48-
In AsciiDoc:
49-
```text
50-
[WARNING]
51-
====
52-
This is a warning paragraph.
53-
====
54-
```
6+
Admonition blocks allow you to highlight important information with varying levels of priority. In software documentation, these blocks are used to emphasize risks, provide helpful advice, or share relevant but non-critical details.
557

56-
In MyST Markdown:
57-
```
58-
:::{warning}
59-
This is a warning paragraph.
60-
:::
61-
```
8+
Admonitions are critical for:
9+
- Preventing data loss or security issues.
10+
- Improving system performance and stability.
11+
- Offering helpful tips for better product usage.
6212

63-
:::{warning}
64-
This is a warning paragraph.
65-
:::
13+
---
6614

67-
## Multi-Paragraph Admonitions
15+
## Types of Admonitions
6816

69-
In AsciiDoc, multi-paragraph admonitions are formatted the same as single paragraphs. In MyST, you can still use the admonition type but separate paragraphs with blank lines.
17+
| **Type** | **When to use it** |
18+
|--------------|-----------------------------------------------------------------------------------|
19+
| **Warning** | You could permanently lose data or leak sensitive information. |
20+
| **Important**| Ignoring the information could impact performance or the stability of your system.|
21+
| **Note** | A relevant piece of information with no serious repercussions if ignored. |
22+
| **Tip** | Advice to help you make better choices when using a feature. |
7023

71-
### Example
24+
---
7225

73-
In AsciiDoc:
74-
```text
75-
[IMPORTANT]
76-
====
77-
This is an important note.
78-
It contains multiple paragraphs.
26+
`````{tab-set}
7927
80-
Make sure to read it carefully.
81-
====
82-
```
28+
````{tab-item} Asciidoc Syntax
8329
84-
In MyST Markdown:
85-
```
86-
:::{important}
87-
This is an important note.
88-
It contains multiple paragraphs.
30+
To create admonitions in Asciidoc, you can use inline or block syntax.
8931
90-
Make sure to read it carefully.
91-
:::
32+
**Inline Admonition:**
9233
```
93-
94-
:::{important}
95-
This is an important note.
96-
It contains multiple paragraphs.
97-
98-
Make sure to read it carefully.
99-
:::
100-
101-
## Custom Titles for Admonitions
102-
103-
To give an admonition a custom title in MyST, use the `admonition` directive with a `class` attribute. This is useful if you want to style the block as one of the core admonition types but need a custom title.
104-
105-
### Example
106-
107-
In AsciiDoc:
108-
```text
109-
[NOTE]
110-
.Title goes here
111-
====
112-
This note has a custom title.
113-
====
34+
NOTE: This is a note.
35+
It can be multiple lines, but not multiple paragraphs.
11436
```
11537
116-
In MyST Markdown:
38+
**Block Admonition:**
11739
```
118-
:::{admonition} Title goes here
119-
:class: note
40+
[WARNING]
41+
=======
42+
This is a warning.
12043
121-
This note has a custom title.
122-
:::
44+
It can contain multiple paragraphs.
45+
=======
12346
```
47+
````
12448
125-
:::{admonition} Title goes here
126-
:class: note
127-
128-
This note has a custom title.
129-
:::
130-
131-
## Collapsible Admonitions
49+
````{tab-item} MD Syntax
13250
133-
In MyST Markdown, you can make an admonition collapsible by adding a `dropdown` class, provided by the `sphinx-togglebutton` extension.
51+
The new build system uses MyST Markdown directives for admonitions.
13452
135-
### Example
53+
**Basic Syntax:**
13654
55+
```{note}
56+
This is a note.
57+
It can span multiple lines and supports inline formatting.
13758
```
138-
:::{note}
139-
:class: dropdown
14059
141-
This admonition can be collapsed, making it useful for longer notes or instructions.
142-
:::
143-
```
60+
**Available Types:**
61+
- `note`
62+
- `caution`
63+
- `tip`
64+
- `attention`
65+
````
66+
`````
14467

145-
:::{note}
146-
:class: dropdown
68+
## Related Issues
14769

148-
This admonition can be collapsed, making it useful for longer notes or instructions.
149-
:::
70+
-

0 commit comments

Comments
 (0)