Skip to content

Commit 7d6d8c6

Browse files
committed
Update usages of :::none, make sure code is written escaping html and ensure callouts are not parsed from example markdown
1 parent a40b0dc commit 7d6d8c6

File tree

12 files changed

+136
-98
lines changed

12 files changed

+136
-98
lines changed

docs/source/docset.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ toc:
2525
- file: admonitions.md
2626
- file: automated_settings.md
2727
- file: code.md
28-
- file: code-callouts.md
2928
- file: conditionals.md
3029
- file: dropdowns.md
3130
- file: example_blocks.md

docs/source/syntax/admonitions.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ Admonitions can span multiple lines and support inline formatting.
2929
3030
A relevant piece of information with no serious repercussions if ignored.
3131
32-
:::none
33-
\`\`\`\{note}
32+
```markdown
33+
:::{note}
3434
This is a note.
3535
It can span multiple lines and supports inline formatting.
36-
\`\`\`
3736
:::
37+
```
3838
3939
:::{note}
4040
This is a note.
@@ -44,11 +44,11 @@ This is a note.
4444
4545
You could permanently lose data or leak sensitive information.
4646
47-
:::none
48-
\`\`\`\{caution}
47+
```markdown
48+
:::{caution}
4949
This is a caution.
50-
\`\`\`
5150
:::
51+
```
5252
5353
```{caution}
5454
This is a caution.
@@ -58,11 +58,11 @@ This is a caution.
5858
5959
Advice to help users make better choices when using a feature.
6060
61-
:::none
62-
\`\`\`\{tip}
61+
```markdown
62+
:::{tip}
6363
This is a tip.
64-
\`\`\`
6564
:::
65+
```
6666
6767
```{tip}
6868
This is a tip.
@@ -72,11 +72,11 @@ This is a tip.
7272
7373
Ignoring this information could impact performance or the stability of your system.
7474
75-
:::none
76-
\`\`\`\{attention}
75+
```markdown
76+
:::{attention}
7777
This is an attention.
78-
\`\`\`
7978
:::
79+
```
8080
8181
```{attention}
8282
This is an attention.
@@ -96,37 +96,38 @@ This is an attention.
9696
9797
9898
**Inline Admonition:**
99-
:::none
99+
```none
100100
NOTE: This is a note.
101101
It can be multiple lines, but not multiple paragraphs.
102-
:::
102+
```
103103
104104
**Block Admonition:**
105-
:::none
105+
106+
```none
106107
[WARNING]
107108
=======
108109
This is a warning.
109110
110111
It can contain multiple paragraphs.
111112
=======
112113
:::
113-
````
114+
```
114115
115116
`````
116117

117118
## Collapsible admonitions
118119

119120
You can use `:open: <bool>` to make an admonition collapsible.
120121

121-
:::none
122-
\`\`\`\{note}
122+
```none
123+
:::{note}
123124
:open:
124125
125126
Longer content can be collapsed to take less space.
126127
127128
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
128-
\`\`\`
129129
:::
130+
```
130131

131132
```{note}
132133
:open:

docs/source/syntax/automated_settings.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Elastic Docs V3 supports the ability to build a markdown settings reference from
66

77
### Syntax
88

9-
:::none
10-
\`\`\`\{settings} /syntax/kibana-alerting-action-settings.yml
11-
\`\`\`
9+
```none
10+
:::{settings} /syntax/kibana-alerting-action-settings.yml
1211
:::
12+
```
1313

1414
### Result
1515

docs/source/syntax/code-callouts.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

docs/source/syntax/code.md

Lines changed: 66 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ Code blocks can be used to display multiple lines of code. They preserve formatt
66

77
### Syntax
88

9-
:::none
10-
\`\`\`yaml
9+
````markdown
10+
```yaml
1111
project:
1212
title: MyST Markdown
1313
github: https://github.com/jupyter-book/mystmd
14-
\`\`\`
15-
:::
14+
```
15+
````
1616

1717
```yaml
1818
project:
@@ -22,15 +22,74 @@ project:
2222
2323
### Asciidoc syntax
2424
25-
:::none
25+
```none
2626
[source,sh]
2727
--------------------------------------------------
2828
GET _tasks
2929
GET _tasks?nodes=nodeId1,nodeId2
3030
GET _tasks?nodes=nodeId1,nodeId2&actions=cluster:*
3131
--------------------------------------------------
32-
:::
32+
```
3333

3434
### Code blocks with callouts
3535

36-
_coming soon!_
36+
A code block can include `<\d+>` at the end to indicate code callouts.
37+
A code block with this style of callouts **needs** to be followed by an ordered list with an equal amount of items as called out.
38+
Otherwise, the docs-builder will throw an error.
39+
40+
This syntax mimics what was implemented for our asciidoc system
41+
42+
````markdown
43+
```yaml
44+
project:
45+
title: MyST Markdown
46+
github: https://github.com/jupyter-book/mystmd
47+
license:
48+
code: MIT
49+
content: CC-BY-4.0 <1>
50+
subject: MyST Markdown
51+
```
52+
53+
1. The license
54+
````
55+
56+
57+
### Magic Callout
58+
59+
You can include the callouts also directly as code using either `//` or `#` comments.
60+
61+
These will then be listed and numbered automatically
62+
63+
````markdown
64+
```csharp
65+
var apiKey = new ApiKey("<API_KEY>"); // Set up the api key
66+
var client = new ElasticsearchClient("<CLOUD_ID>", apiKey);
67+
```
68+
````
69+
70+
Will output:
71+
72+
```csharp
73+
var apiKey = new ApiKey("<API_KEY>"); // Set up the api key
74+
var client = new ElasticsearchClient("<CLOUD_ID>", apiKey);
75+
```
76+
77+
```{note}
78+
the comments have the follow code to be hoisted as a callout.
79+
```
80+
81+
````markdown
82+
```csharp
83+
// THIS IS NOT A CALLOUT
84+
var apiKey = new ApiKey("<API_KEY>"); // However this is
85+
var client = new ElasticsearchClient("<CLOUD_ID>", apiKey);
86+
```
87+
````
88+
89+
will output:
90+
91+
```csharp
92+
// THIS IS NOT A CALLOUT
93+
var apiKey = new ApiKey("<API_KEY>"); // However this is
94+
var client = new ElasticsearchClient("<CLOUD_ID>", apiKey);
95+
```

docs/source/syntax/dropdowns.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ Dropdowns allow you to hide and reveal content on user interaction.
88

99
By default, dropdowns are collapsed. This hides content until a user clicks the title of the collapsible block.
1010

11-
:::none
12-
\`\`\`\{dropdown} Dropdown Title
11+
```markdown
12+
:::{dropdown} Dropdown Title
1313
Dropdown content
14-
\`\`\`
1514
:::
15+
```
1616

17-
```{dropdown} Dropdown Title
17+
:::{dropdown} Dropdown Title
1818
Dropdown content
19-
```
19+
:::
2020

2121
### Asciidoc syntax
2222

23-
:::none
23+
```asciidoc
2424
.The `elasticsearch-setup-passwords` tool is deprecated.
2525
[%collapsible]
2626
====
@@ -38,18 +38,18 @@ for the first time. If you run `elasticsearch-setup-passwords` after
3838
starting {es}, it will fail because the `elastic`
3939
user password is already configured.
4040
====
41-
:::
41+
```
4242

4343
### Open by default
4444

4545
You can also specify that the content should be visible by default, but can also be collapsed by the user. Do this by specifying the `open` option.
4646

47-
:::none
48-
\`\`\`\{dropdown} Dropdown Title
47+
```markdown
48+
:::{dropdown} Dropdown Title
4949
:open:
5050
Dropdown content
51-
\`\`\`
5251
:::
52+
```
5353

5454
```{dropdown} Dropdown Title
5555
:open:

docs/source/syntax/file_inclusion.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ If there are portions of content that are relevant to multiple pages, you can in
1111

1212
### Syntax
1313

14-
:::none
15-
\`\`\`\{include} _snippets/my_snippet.md
16-
\`\`\`
14+
```markdown
15+
:::{include} _snippets/my_snippet.md
1716
:::
18-
19-
```{include} _snippets/my_snippet.md
2017
```
2118

19+
:::{include} _snippets/my_snippet.md
20+
:::
21+
2222
### Asciidoc syntax
2323

24-
:::none
24+
```asciidoc
2525
include::shared-monitor-config.asciidoc[]
26-
:::
26+
```

docs/source/syntax/images.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ Screenshots get a box-shadow.
1616

1717
## Block-level images
1818

19-
:::none
20-
\!\[APM](/_static/img/apm.png)
21-
:::
19+
```markdown
20+
![APM](/_static/img/apm.png)
21+
```
2222

2323
![APM](/_static/img/apm.png)
2424

2525
Or, use the `image` directive.
2626

27-
:::none
28-
\`\`\`\{image} /_static/img/observability.png
27+
```markdown
28+
:::{image} /_static/img/observability.png
2929
:alt: Elasticsearch
3030
:width: 250px
31-
\`\`\`
3231
:::
32+
```
3333

3434
```{image} /_static/img/observability.png
3535
:alt: Elasticsearch
@@ -38,19 +38,19 @@ Or, use the `image` directive.
3838

3939
## Inline image
4040

41-
:::none
42-
Here is the same image used inline \!\[Elasticsearch](/_static/img/observability.png)\{width=30px}
43-
:::
41+
```markdown
42+
Here is the same image used inline ![Elasticsearch](/_static/img/observability.png)
43+
```
4444

45-
Here is the same image used inline ![Elasticsearch](/_static/img/observability.png){width=30px}.
45+
Here is the same image used inline ![Elasticsearch](/_static/img/observability.png)
4646

4747
## Asciidoc syntax
4848

49-
:::none
49+
```asciidoc
5050
[role="screenshot"]
5151
image::images/metrics-alert-filters-and-group.png[Metric threshold filter and group fields]
52-
:::
52+
```
5353

54-
:::none
54+
```asciidoc
5555
image::images/synthetics-get-started-projects.png[]
56-
:::
56+
```

0 commit comments

Comments
 (0)