Skip to content

Commit 71900b7

Browse files
authored
Docs & Syntax guide updates (#129)
1 parent 30afb01 commit 71900b7

File tree

9 files changed

+167
-135
lines changed

9 files changed

+167
-135
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# docs-builder.
1+
# docs-builder
22

33
You've reached the home of the latest incarnation of the documentation tooling.
44

@@ -131,15 +131,17 @@ https://github.com/elastic/{your-repository}/settings/pages
131131

132132
## Run without docker
133133

134-
If you have dotnet 8 installed you can use its CLI to publish a self-contained `docs-builder` native code
134+
You can use the .NET CLI to publish a self-contained `docs-builder` native code
135135
binary. (On my M2 Pro mac the binary is currently 13mb)
136136

137+
Install [.NET 9.0](https://dotnet.microsoft.com/en-us/download/dotnet/9.0), then run:
138+
137139
```bash
138140
dotnet publish "src/docs-builder/docs-builder.csproj" -c Release -o .artifacts/publish \
139141
--self-contained true /p:PublishTrimmed=true /p:PublishSingleFile=false /p:PublishAot=true -a arm64
140142
```
141143

142-
**Note**: `-a` should be the machines CPU architecture
144+
**Note**: `-a` should be the machine's CPU architecture
143145

144146
The resulting binary `./.artifacts/publish/docs-builder` will run on machines without .NET installed
145147

docs/source/syntax/admonitions.md

Lines changed: 37 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,14 @@ Admonitions allow you to highlight important information with varying levels of
77
## Basic admonitions
88

99
Admonitions can span multiple lines and support inline formatting.
10+
Available admonition types include:
1011

11-
`````{tab-set}
12+
- Note
13+
- Warning
14+
- Tip
15+
- Important
1216

13-
````{tab-item} MD Syntax
14-
15-
### Available admonition types
16-
17-
- `note`
18-
- `warning`
19-
- `tip`
20-
- `important`
21-
22-
### Syntax
23-
24-
**Note**
17+
### Note
2518

2619
A relevant piece of information with no serious repercussions if ignored.
2720

@@ -36,7 +29,7 @@ It can span multiple lines and supports inline formatting.
3629
This is a note.
3730
:::
3831

39-
**Warning**
32+
### Warning
4033

4134
You could permanently lose data or leak sensitive information.
4235

@@ -50,7 +43,7 @@ This is a warning.
5043
This is a warning.
5144
```
5245

53-
**Tip**
46+
### Tip
5447

5548
Advice to help users make better choices when using a feature.
5649

@@ -64,7 +57,7 @@ This is a tip.
6457
This is a tip.
6558
```
6659

67-
**Important**
60+
### Important
6861

6962
Ignoring this information could impact performance or the stability of your system.
7063

@@ -78,43 +71,15 @@ This is an important notice.
7871
This is an important notice.
7972
```
8073

81-
````
82-
83-
````{tab-item} Asciidoc Syntax
84-
85-
| **Asciidoc Type** | **When to use it** |
86-
|--------------|-----------------------------------------------------------------------------------|
87-
| **Warning** | You could permanently lose data or leak sensitive information. |
88-
| **Important**| Ignoring the information could impact performance or the stability of your system.|
89-
| **Note** | A relevant piece of information with no serious repercussions if ignored. |
90-
| **Tip** | Advice to help you make better choices when using a feature. |
91-
92-
93-
**Inline Admonition:**
94-
```none
95-
NOTE: This is a note.
96-
It can be multiple lines, but not multiple paragraphs.
97-
```
98-
99-
**Block Admonition:**
100-
101-
```none
102-
[WARNING]
103-
=======
104-
This is a warning.
74+
## Collapsible admonitions
10575

106-
It can contain multiple paragraphs.
107-
=======
108-
:::
76+
```{tip}
77+
Also see [dropdowns](./dropdowns.md).
10978
```
11079

111-
`````
112-
113-
## Collapsible admonitions
80+
Use `:open: <bool>` to make an admonition collapsible.
11481

115-
You can use `:open: <bool>` to make an admonition collapsible.
116-
117-
```none
82+
```markdown
11883
:::{note}
11984
:open:
12085

@@ -131,3 +96,26 @@ Longer content can be collapsed to take less space.
13196
13297
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.
13398
```
99+
100+
---
101+
102+
## Asciidoc Syntax
103+
104+
### Inline Admonition
105+
106+
```markdown
107+
NOTE: This is a note.
108+
It can be multiple lines, but not multiple paragraphs.
109+
```
110+
111+
### Block Admonition
112+
113+
```markdown
114+
[WARNING]
115+
=======
116+
This is a warning.
117+
118+
It can contain multiple paragraphs.
119+
=======
120+
:::
121+
```

docs/source/syntax/automated_settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Elastic Docs V3 supports the ability to build a markdown settings reference from
66

77
### Syntax
88

9-
```none
9+
```markdown
1010
:::{settings} /syntax/kibana-alerting-action-settings.yml
1111
:::
1212
```

docs/source/syntax/code.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ project:
2222
2323
### Asciidoc syntax
2424
25-
```none
25+
```markdown
2626
[source,sh]
2727
--------------------------------------------------
2828
GET _tasks
@@ -33,28 +33,28 @@ GET _tasks?nodes=nodeId1,nodeId2&actions=cluster:*
3333

3434
### Code blocks with callouts
3535

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.
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.
3838
Otherwise, the docs-builder will throw an error.
3939

4040
This syntax mimics what was implemented for our asciidoc system
4141

4242
````markdown
4343
```yaml
4444
project:
45-
title: MyST Markdown
45+
title: MyST Markdown
4646
github: https://github.com/jupyter-book/mystmd
4747
license:
4848
code: MIT
4949
content: CC-BY-4.0 <1>
50-
subject: MyST Markdown
50+
subject: MyST Markdown
5151
```
5252

5353
1. The license
5454
````
5555

5656

57-
### Magic Callout
57+
### Magic Callout
5858

5959
You can include the callouts also directly as code using either `//` or `#` comments.
6060

@@ -63,26 +63,26 @@ These will then be listed and numbered automatically
6363
````markdown
6464
```csharp
6565
var apiKey = new ApiKey("<API_KEY>"); // Set up the api key
66-
var client = new ElasticsearchClient("<CLOUD_ID>", apiKey);
66+
var client = new ElasticsearchClient("<CLOUD_ID>", apiKey);
6767
```
6868
````
6969

7070
Will output:
7171

7272
```csharp
7373
var apiKey = new ApiKey("<API_KEY>"); // Set up the api key
74-
var client = new ElasticsearchClient("<CLOUD_ID>", apiKey);
74+
var client = new ElasticsearchClient("<CLOUD_ID>", apiKey);
7575
```
7676

77-
```{note}
77+
```{note}
7878
the comments have the follow code to be hoisted as a callout.
7979
```
8080

8181
````markdown
8282
```csharp
8383
// THIS IS NOT A CALLOUT
8484
var apiKey = new ApiKey("<API_KEY>"); // However this is
85-
var client = new ElasticsearchClient("<CLOUD_ID>", apiKey);
85+
var client = new ElasticsearchClient("<CLOUD_ID>", apiKey);
8686
```
8787
````
8888

@@ -91,5 +91,5 @@ will output:
9191
```csharp
9292
// THIS IS NOT A CALLOUT
9393
var apiKey = new ApiKey("<API_KEY>"); // However this is
94-
var client = new ElasticsearchClient("<CLOUD_ID>", apiKey);
94+
var client = new ElasticsearchClient("<CLOUD_ID>", apiKey);
9595
```

docs/source/syntax/dropdowns.md

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
title: Dropdowns
33
---
44

5-
Dropdowns allow you to hide and reveal content on user interaction.
5+
Dropdowns allow you to hide and reveal content on user interaction. By default, dropdowns are collapsed. This hides content until a user clicks the title of the collapsible block.
66

7-
### Syntax
8-
9-
By default, dropdowns are collapsed. This hides content until a user clicks the title of the collapsible block.
7+
## Syntax
108

119
```markdown
1210
:::{dropdown} Dropdown Title
@@ -18,7 +16,23 @@ Dropdown content
1816
Dropdown content
1917
:::
2018

21-
### Asciidoc syntax
19+
### Open by default
20+
21+
You can specify that the dropdown content should be visible by default. Do this by specifying the `open` option. Users can collapse content by clicking on the dropdown title.
22+
23+
```markdown
24+
:::{dropdown} Dropdown Title
25+
:open:
26+
Dropdown content
27+
:::
28+
```
29+
30+
```{dropdown} Dropdown Title
31+
:open:
32+
Dropdown content
33+
```
34+
35+
## Asciidoc syntax
2236

2337
```asciidoc
2438
.The `elasticsearch-setup-passwords` tool is deprecated.
@@ -39,19 +53,3 @@ starting {es}, it will fail because the `elastic`
3953
user password is already configured.
4054
====
4155
```
42-
43-
### Open by default
44-
45-
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.
46-
47-
```markdown
48-
:::{dropdown} Dropdown Title
49-
:open:
50-
Dropdown content
51-
:::
52-
```
53-
54-
```{dropdown} Dropdown Title
55-
:open:
56-
Dropdown content
57-
```

docs/source/syntax/frontmatter.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,10 @@ title: Frontmatter
44

55
Each MD file referenced in the TOC requires frontmatter. Frontmatter is YAML-formatted metadata about a page, at the beginning of each file.
66

7+
Supported frontmatter includes:
78

8-
## Title
9-
10-
tbd
11-
12-
[Title](./titles.md) link.
13-
14-
15-
## Applies to
16-
17-
tbd
18-
19-
[Applies](./applies.md) link.
9+
| Frontmatter | Learn more |
10+
| ------------------- | --------------------------- |
11+
| `title` | See [title](./titles.md) |
12+
| `navigation_title` | See [title](./titles.md) |
13+
| `applies` | See [product availability](./applies.md) |

docs/source/syntax/images.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22
title: Images
33
---
44

5-
Images include screenshots, inline images, icons, and more.
5+
Images include screenshots, inline images, icons, and more. Syntax for images is like the syntax for links, with two differences:
6+
1. instead of link text, you provide an image description
7+
2. an image description starts with `![` not just `[`
68

79
Images can be referenced from the top-level `_static` dir or a local image dir.
810

911
## Screenshots
1012

13+
Screenshots are images displayed with a box-shadow.
14+
1115
```{warning}
1216
This feature is not currently supported in Elastic Docs V3.
1317
```
1418

15-
Screenshots get a box-shadow.
16-
1719
## Block-level images
1820

1921
```markdown
@@ -36,7 +38,7 @@ Or, use the `image` directive.
3638
:width: 250px
3739
```
3840

39-
## Inline image
41+
## Inline images
4042

4143
```markdown
4244
Here is the same image used inline ![Elasticsearch](/_static/img/observability.png)

docs/source/syntax/links.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,32 @@
22
title: Links
33
---
44

5-
tbd
5+
A link contains link text (the visible text) and a link destination (the URI that is the link destination). The link text can include inline elements.
6+
7+
## Inline link
8+
9+
```
10+
[Link title](links.md)
11+
```
12+
13+
[Link title](links.md)
14+
15+
```
16+
[**Hi**, _I'm md_](links.md)
17+
```
18+
19+
[**Hi**, _I'm md_](links.md)
20+
21+
## Anchor link
22+
23+
You can link to a heading on a page with an anchor link. The link destination should be a `#` followed by the header text. Convert spaces to dashes (`-`).
24+
25+
```
26+
I link to the [Inline link](#inline-link) heading above.
27+
```
28+
29+
I link to the [Inline link](#inline-link) heading above.
30+
31+
```
32+
I link to the [Notes](tables.md#notes) heading on the [Tables](tables.md) page.
33+
```

0 commit comments

Comments
 (0)