Skip to content

Commit 453dc9e

Browse files
committed
Merge branch 'main' into feature/synonyms_as_code
# Conflicts: # src/Elastic.Markdown/Exporters/Elasticsearch/ElasticsearchMarkdownExporter.cs
2 parents b8fbd6d + 224b089 commit 453dc9e

File tree

27 files changed

+2341
-199
lines changed

27 files changed

+2341
-199
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<PackageVersion Include="Elastic.Aspire.Hosting.Elasticsearch" Version="9.3.0" />
3030
<PackageVersion Include="Elastic.Clients.Elasticsearch" Version="9.1.4" />
3131
<PackageVersion Include="FakeItEasy" Version="8.3.0" />
32-
<PackageVersion Include="Elastic.Ingest.Elasticsearch" Version="0.16.0" />
32+
<PackageVersion Include="Elastic.Ingest.Elasticsearch" Version="0.16.3" />
3333
<PackageVersion Include="InMemoryLogger" Version="1.0.66" />
3434
<PackageVersion Include="MartinCostello.Logging.XUnit.v3" Version="0.6.0" />
3535
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.7" />

config/navigation.yml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,7 @@ toc:
2222
- toc: deploy-manage
2323
- toc: cloud-account
2424
- toc: troubleshoot
25-
- toc: contribute-docs
2625

27-
##########
28-
# EXTEND #
29-
##########
30-
# I didn't touch this section (yet?)
31-
- toc: extend
32-
children:
33-
- toc: kibana://extend
34-
path_prefix: extend/kibana
35-
- toc: logstash://extend
36-
path_prefix: extend/logstash
37-
- toc: beats://extend
38-
path_prefix: extend/beats
39-
- toc: elasticsearch://extend
40-
path_prefix: extend/elasticsearch
41-
- toc: integrations://extend
42-
path_prefix: extend/integrations
4326

4427
#################
4528
# RELEASE NOTES #
@@ -605,3 +588,24 @@ toc:
605588
# https://github.com/elastic/docs-content/blob/main/reference/glossary/toc.yml
606589
- toc: docs-content://reference/glossary
607590
path_prefix: reference/glossary
591+
592+
##########
593+
# EXTEND #
594+
##########
595+
- toc: extend
596+
children:
597+
- toc: kibana://extend
598+
path_prefix: extend/kibana
599+
- toc: logstash://extend
600+
path_prefix: extend/logstash
601+
- toc: beats://extend
602+
path_prefix: extend/beats
603+
- toc: elasticsearch://extend
604+
path_prefix: extend/elasticsearch
605+
- toc: integrations://extend
606+
path_prefix: extend/integrations
607+
608+
#############
609+
# CONTRIBUTE 2 DOCS #
610+
#############
611+
- toc: contribute-docs

docs/_docset.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ toc:
123123
- file: index.md
124124
- file: build.md
125125
- file: diff-validate.md
126+
- file: format.md
126127
- file: index-command.md
127128
- file: mv.md
128129
- file: serve.md

docs/cli/docset/format.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# format
2+
3+
Format documentation files by fixing common issues like irregular space
4+
5+
## Usage
6+
7+
```
8+
docs-builder format --check [options...]
9+
docs-builder format --write [options...]
10+
```
11+
12+
## Options
13+
14+
`--check`
15+
: Check if files need formatting without modifying them. Exits with code 1 if formatting is needed, 0 if all files are properly formatted. (required, mutually exclusive with --write)
16+
17+
`--write`
18+
: Write formatting changes to files. (required, mutually exclusive with --check)
19+
20+
`-p|--path` `<string>`
21+
: Path to the documentation folder, defaults to pwd. (optional)
22+
23+
## Description
24+
25+
The `format` command automatically detects and fixes formatting issues in your documentation files. The command only processes Markdown files (`.md`) that are included in your `_docset.yml` table of contents, ensuring that only intentional documentation files are modified.
26+
27+
You must specify exactly one of `--check` or `--write`:
28+
- `--check` validates formatting without modifying files, useful for CI/CD pipelines
29+
- `--write` applies formatting changes to files
30+
31+
Currently, it handles irregular space characters that may impair Markdown rendering.
32+
33+
### Irregular Space Detection
34+
35+
The format command detects and replaces 24 types of irregular space characters with regular spaces, including:
36+
37+
- No-Break Space (U+00A0)
38+
- En Space (U+2002)
39+
- Em Space (U+2003)
40+
- Zero Width Space (U+200B)
41+
- Line Separator (U+2028)
42+
- Paragraph Separator (U+2029)
43+
- And 18 other irregular space variants
44+
45+
These characters can cause unexpected rendering issues in Markdown and are often introduced accidentally through copy-paste operations from other applications.
46+
47+
## Examples
48+
49+
### Check if formatting is needed (CI/CD)
50+
51+
```bash
52+
docs-builder format --check
53+
```
54+
55+
Exit codes:
56+
- `0`: All files are properly formatted
57+
- `1`: Some files need formatting
58+
59+
### Apply formatting changes
60+
61+
```bash
62+
docs-builder format --write
63+
```
64+
65+
### Check specific documentation folder
66+
67+
```bash
68+
docs-builder format --check --path /path/to/docs
69+
```
70+
71+
### Format specific documentation folder
72+
73+
```bash
74+
docs-builder format --write --path /path/to/docs
75+
```
76+
77+
## Output
78+
79+
### Check mode output
80+
81+
When using `--check`, the command reports which files need formatting:
82+
83+
```
84+
Checking documentation in: /path/to/docs
85+
86+
Formatting needed:
87+
Files needing formatting: 2
88+
irregular space fixes needed: 3
89+
90+
Run 'docs-builder format --write' to apply changes
91+
```
92+
93+
### Write mode output
94+
95+
When using `--write`, the command reports the changes made:
96+
97+
```
98+
Formatting documentation in: /path/to/docs
99+
Formatted index.md (2 change(s))
100+
101+
Formatting complete:
102+
Files processed: 155
103+
Files modified: 1
104+
irregular space fixes: 2
105+
```
106+
107+
## Future Enhancements
108+
109+
The format command is designed to be extended with additional formatting capabilities in the future, such as:
110+
111+
- Line ending normalization
112+
- Trailing whitespace removal
113+
- Consistent heading spacing
114+
- And other formatting fixes

docs/contribute/on-the-web.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This section will help you understand how to update and contribute to our documentation post-migration.
44

5+
:::{tip}
6+
Every documentation page includes a **Learn how to contribute** link in the sidebar that takes you to the [Elastic Docs contribution guide](https://docs-v3-preview.elastic.dev/elastic/docs-builder/tree/main/contribute/). Use it whenever you want to contribute!
7+
:::
8+
59
## Updating documentation
610

711
:::{include} _snippets/two-systems.md
@@ -56,4 +60,4 @@ If you need to merge changes that are published in both systems (usually because
5660

5761
## Migration considerations
5862

59-
During the migration, content may be moved around, and there won't be a 1-to-1 mapping between old and new locations. This means updates may need to be applied in multiple places. If your changes affect /guide content, consider merging those changes in the /docs content first and then add it to the appropriate /guide content. If you have any issues, create an issue in the [`docs-content`](https://github.com/elastic/docs-content) or [`docs-content-internal`](https://github.com/elastic/docs-content-internal) repository.
63+
During the migration, content may be moved around, and there won't be a 1-to-1 mapping between old and new locations. This means updates may need to be applied in multiple places. If your changes affect /guide content, consider merging those changes in the /docs content first and then add it to the appropriate /guide content. If you have any issues, create an issue in the [`docs-content`](https://github.com/elastic/docs-content) or [`docs-content-internal`](https://github.com/elastic/docs-content-internal) repository.

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ navigation_title: Elastic Docs v3
44

55
# Welcome to Elastic Docs v3
66

7-
Elastic Docs V3 is our next-generation documentation platform designed to improve the experience of learning, using, and contributing to Elastic products. Built on a foundation of modern authoring tools and scalable infrastructure, V3 offers faster builds, streamlined versioning, and enhanced navigation to guide users through Elastic’s complex ecosystem.
7+
Elastic Docs V3 is our next-generation documentation platform designed to improve the experience of learning, using, and contributing to Elastic products. Built on a foundation of modern authoring tools and scalable infrastructure, V3 offers faster builds, streamlined versioning, and enhanced navigation to guide users through Elastic’s complex ecosystem.
88

99
## What do you want to do today?
1010

src/Elastic.Documentation.Configuration/ConfigurationFileProvider.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,16 @@ public IFileInfo CreateNavigationFile(AssemblyConfiguration configuration)
168168
// language=yaml
169169
_fileSystem.File.AppendAllText(tempFile,
170170
"""
171-
- toc: docs-builder://
172-
path_prefix: reference/docs-builder
173-
children:
174-
- toc: docs-builder://development
175-
path_prefix: reference/docs-builder/dev
176-
children:
177-
- toc: docs-builder://development/link-validation
178-
path_prefix: reference/docs-builder/dev/link-val
179-
180-
""");
171+
172+
- toc: docs-builder://
173+
path_prefix: reference/docs-builder
174+
children:
175+
- toc: docs-builder://development
176+
path_prefix: reference/docs-builder/dev
177+
children:
178+
- toc: docs-builder://development/link-validation
179+
path_prefix: reference/docs-builder/dev/link-val
180+
""");
181181
}
182182
NavigationFile = _fileSystem.FileInfo.New(tempFile);
183183
return NavigationFile;

0 commit comments

Comments
 (0)