Skip to content

Commit cb10226

Browse files
committed
various docs / syntax guide updates
1 parent b0d6452 commit cb10226

File tree

7 files changed

+124
-74
lines changed

7 files changed

+124
-74
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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ This is an important notice.
7373

7474
## Collapsible admonitions
7575

76+
```{tip}
77+
Also see [dropdowns](./dropdowns.md).
78+
```
79+
7680
Use `:open: <bool>` to make an admonition collapsible.
7781

7882
```markdown

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: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,34 @@
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.html)
11+
```
12+
13+
[Link title](links.html)
14+
15+
```
16+
[**Hi**, _I'm md_](links.html)
17+
```
18+
19+
[**Hi**, _I'm md_](links.html)
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.html#notes) heading on the [Tables](tables.html) page.
33+
```
34+
35+
I link to the [Notes](tables.html#notes) heading on the [Tables](tables.html) page.

docs/source/syntax/tables.md

Lines changed: 53 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,68 @@
22
title: Tables
33
---
44

5-
## GFM Table
5+
A table is an arrangement of data with rows and columns. Each row consists of cells containing arbitrary text in which inlines are parsed, separated by pipes `|`. The rows of a table consist of:
66

7-
You can use the GFM (GitHub Flavored Markdown) table syntax to create a table.
7+
* a single header row
8+
* a delimiter row separating the header from the data
9+
* zero or more data rows
810

9-
| Country | Capital |
10-
| ------- | --------------- |
11-
| USA | Washington D.C. |
12-
| Canada | Ottawa |
11+
## Notes
1312

14-
## `{table}` Directive
13+
* A leading and trailing pipe is recommended for clarity of reading
14+
* Spaces between pipes and cell content are trimmed
15+
* Block-level elements cannot be inserted in a table
1516

16-
You can use the `table` directive which gives you configuration captions such as caption and alignment.
17+
## GitHub Flavored Markdown (GFM) Table
1718

18-
```{table} Countries and their capitals
19-
:widths: auto
20-
:align: center
19+
You can use the GFM table syntax to create a table:
2120

21+
```
2222
| Country | Capital |
2323
| ------- | --------------- |
2424
| USA | Washington D.C. |
2525
| Canada | Ottawa |
2626
```
2727

28-
## `{list-table}` Directive
29-
30-
You can also use the `list-table` directive to create a table from data.
31-
32-
```{list-table} Frozen Delights!
33-
:widths: 15 10 30
34-
:header-rows: 1
35-
36-
* - Treat
37-
- Quantity
38-
- Description
39-
* - Albatross
40-
- 2.99
41-
- On a stick!
42-
* - Crunchy Frog
43-
- 1.49
44-
- If we took the bones out, it wouldn't be
45-
crunchy, now would it?
46-
* - Gannet Ripple
47-
- 1.99
48-
- On a stick!
49-
```
28+
| Country | Capital |
29+
| ------- | --------------- |
30+
| USA | Washington D.C. |
31+
| Canada | Ottawa |
32+
33+
% Neither of these work
34+
% ## `{table}` Directive
35+
%
36+
% You can use the `table` directive which gives you configuration captions such as caption and alignment.
37+
%
38+
% ```{table} Countries and their capitals
39+
% :widths: auto
40+
% :align: right
41+
%
42+
% | Country | Capital |
43+
% | ------- | --------------- |
44+
% | USA | Washington D.C. |
45+
% | Canada | Ottawa |
46+
% ``` -->
47+
%
48+
% <!-- ## `{list-table}` Directive
49+
%
50+
% You can also use the `list-table` directive to create a table from data.
51+
%
52+
% ```{list-table} Frozen Delights!
53+
% :widths: 15 10 30
54+
% :header-rows: 1
55+
%
56+
% * - Treat
57+
% - Quantity
58+
% - Description
59+
% * - Albatross
60+
% - 2.99
61+
% - On a stick!
62+
% * - Crunchy Frog
63+
% - 1.49
64+
% - If we took the bones out, it wouldn't be
65+
% crunchy, now would it?
66+
% * - Gannet Ripple
67+
% - 1.99
68+
% - On a stick!
69+
% ```

0 commit comments

Comments
 (0)