Skip to content

Commit f9152a2

Browse files
committed
Initial seed commit with documentation
0 parents  commit f9152a2

File tree

92 files changed

+6553
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+6553
-0
lines changed

.editorconfig

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
root=true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = tab
6+
indent_size = 4
7+
# Spell checker configuration
8+
spelling_exclusion_path = "./build/exclusion.dic"
9+
10+
[*.{fs,fsx,cs,vb}]
11+
file_header_template=Licensed to Elasticsearch B.V under one or more agreements.\nElasticsearch B.V licenses this file to you under the Apache 2.0 License.\nSee the LICENSE file in the project root for more information
12+
13+
[*.{fs,fsx}]
14+
indent_style = space
15+
indent_size = 4
16+
17+
[*.{md,markdown,json,js,yml,csproj,fsproj,targets,targets,props}]
18+
indent_style = space
19+
indent_size = 2
20+
21+
# Dotnet code style settings:
22+
[*.{cs,vb}]
23+
trim_trailing_whitespace=true
24+
insert_final_newline=true
25+
# ---
26+
# naming conventions https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions
27+
# currently not supported in Rider/Resharper so not using these for now
28+
# ---
29+
30+
# ---
31+
# language conventions https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#language-conventions
32+
33+
# Sort using and Import directives with System.* appearing first
34+
dotnet_sort_system_directives_first = true
35+
36+
# Style rules
37+
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/naming-rules?view=vs-2017
38+
39+
# Constants always pascal case
40+
dotnet_naming_rule.constants_should_be_pascal_case.symbols = consts
41+
dotnet_naming_rule.constants_should_be_pascal_case.style = consts
42+
dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion
43+
44+
dotnet_naming_symbols.consts.applicable_kinds = field
45+
dotnet_naming_symbols.consts.applicable_accessibilities = *
46+
dotnet_naming_symbols.consts.required_modifiers = const
47+
48+
dotnet_naming_style.consts.capitalization = pascal_case
49+
50+
# Non-public static fields always pascal case
51+
dotnet_naming_rule.non_public_static_fields_should_be_pascal_case.symbols = non_public_static_fields
52+
dotnet_naming_rule.non_public_static_fields_should_be_pascal_case.style = non_public_static_fields
53+
dotnet_naming_rule.non_public_static_fields_should_be_pascal_case.severity = suggestion
54+
55+
dotnet_naming_symbols.non_public_static_fields.applicable_kinds = field
56+
dotnet_naming_symbols.non_public_static_fields.applicable_accessibilities = private,protected,internal,protected_internal,private_protected
57+
dotnet_naming_symbols.non_public_static_fields.required_modifiers = static
58+
59+
dotnet_naming_style.non_public_static_fields.capitalization = pascal_case
60+
61+
# Non-private readonly fields are pascal case
62+
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.severity = suggestion
63+
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.symbols = non_private_readonly_fields
64+
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.style = non_private_readonly_fields
65+
66+
dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field
67+
dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public,protected,internal,protected_internal,private_protected
68+
dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly
69+
70+
dotnet_naming_style.non_private_readonly_fields.capitalization = pascal_case
71+
72+
# Private instance fields are camel case prefixed underscore
73+
dotnet_naming_rule.private_fields_should_be_camelcase_prefix_underscore.symbols = private_fields
74+
dotnet_naming_rule.private_fields_should_be_camelcase_prefix_underscore.style = private_fields
75+
dotnet_naming_rule.private_fields_should_be_camelcase_prefix_underscore.severity = suggestion
76+
77+
dotnet_naming_symbols.private_fields.applicable_kinds = field
78+
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
79+
80+
dotnet_naming_style.private_fields.capitalization = camel_case
81+
dotnet_naming_style.private_fields.required_prefix = _
82+
83+
# Locals and parameters are camel case
84+
dotnet_naming_rule.locals.severity = suggestion
85+
dotnet_naming_rule.locals.symbols = locals
86+
dotnet_naming_rule.locals.style = locals
87+
88+
dotnet_naming_symbols.locals.applicable_kinds = parameter, local
89+
90+
dotnet_naming_style.locals.capitalization = camel_case
91+
92+
# Local functions are pascal case
93+
dotnet_naming_rule.local_functions.severity = suggestion
94+
dotnet_naming_rule.local_functions.symbols = local_functions
95+
dotnet_naming_rule.local_functions.style = local_functions
96+
97+
dotnet_naming_symbols.local_functions.applicable_kinds = local_function
98+
99+
dotnet_naming_style.local_functions.capitalization = pascal_case
100+
101+
# Public members always pascal case
102+
dotnet_naming_rule.public_members_should_be_pascal_case.symbols = public_members
103+
dotnet_naming_rule.public_members_should_be_pascal_case.style = public_members
104+
dotnet_naming_rule.public_members_should_be_pascal_case.severity = suggestion
105+
106+
dotnet_naming_symbols.public_members.applicable_kinds = property,method,field,event,delegate
107+
dotnet_naming_symbols.public_members.applicable_accessibilities = public
108+
109+
dotnet_naming_style.public_members.capitalization = pascal_case
110+
111+
dotnet_style_qualification_for_field = false:error
112+
dotnet_style_qualification_for_property = false:error
113+
dotnet_style_qualification_for_method = false:error
114+
dotnet_style_qualification_for_event = false:error
115+
116+
# Use language keywords instead of framework type names for type references
117+
dotnet_style_predefined_type_for_locals_parameters_members = true:error
118+
dotnet_style_predefined_type_for_member_access = true:error
119+
120+
# Suggest more modern language features when available
121+
dotnet_style_object_initializer = true:error
122+
dotnet_style_collection_initializer = true:error
123+
dotnet_style_explicit_tuple_names = true:error
124+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:error
125+
dotnet_style_prefer_inferred_tuple_names = true:error
126+
dotnet_style_coalesce_expression = true:error
127+
dotnet_style_null_propagation = true:error
128+
129+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:error
130+
dotnet_style_readonly_field = true:error
131+
132+
# CSharp code style settings:
133+
[*.cs]
134+
# Prefer "var" everywhere
135+
csharp_style_var_for_built_in_types = true:error
136+
csharp_style_var_when_type_is_apparent = true:error
137+
csharp_style_var_elsewhere = true:error
138+
139+
csharp_style_expression_bodied_methods = true:suggestion
140+
csharp_style_expression_bodied_constructors = true:suggestion
141+
csharp_style_expression_bodied_operators = true:suggestion
142+
csharp_style_expression_bodied_properties = true:suggestion
143+
csharp_style_expression_bodied_indexers = true:suggestion
144+
csharp_style_expression_bodied_accessors = true:suggestion
145+
146+
# Suggest more modern language features when available
147+
csharp_style_pattern_matching_over_is_with_cast_check = true:error
148+
csharp_style_pattern_matching_over_as_with_null_check = true:error
149+
csharp_style_inlined_variable_declaration = true:error
150+
csharp_style_deconstructed_variable_declaration = true:error
151+
csharp_style_pattern_local_over_anonymous_function = true:error
152+
csharp_style_throw_expression = true:error
153+
csharp_style_conditional_delegate_call = true:error
154+
155+
csharp_prefer_braces = false:warning
156+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:error
157+
158+
# ---
159+
# formatting conventions https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#formatting-conventions
160+
161+
# Newline settings (Allman yo!)
162+
csharp_new_line_before_open_brace = all
163+
csharp_new_line_before_else = true
164+
csharp_new_line_before_catch = true
165+
csharp_new_line_before_finally = true
166+
csharp_new_line_before_members_in_object_initializers = true
167+
# just a suggestion do to our JSON tests that use anonymous types to
168+
# represent json quite a bit (makes copy paste easier).
169+
csharp_new_line_before_members_in_anonymous_types = true
170+
csharp_new_line_between_query_expression_clauses = true
171+
172+
# Indent
173+
csharp_indent_case_contents = true
174+
csharp_indent_switch_labels = true
175+
csharp_space_after_cast = false
176+
csharp_space_after_keywords_in_control_flow_statements = true
177+
csharp_space_between_method_declaration_parameter_list_parentheses = false
178+
csharp_space_between_method_call_parameter_list_parentheses = false
179+
180+
#Wrap
181+
csharp_preserve_single_line_statements = false
182+
csharp_preserve_single_line_blocks = true
183+
184+
# Resharper
185+
resharper_csharp_braces_for_lock=required_for_multiline
186+
resharper_csharp_braces_for_using=required_for_multiline
187+
resharper_csharp_braces_for_while=required_for_multiline
188+
resharper_csharp_braces_for_foreach=required_for_multiline
189+
resharper_csharp_braces_for_for=required_for_multiline
190+
resharper_csharp_braces_for_fixed=required_for_multiline
191+
resharper_csharp_braces_for_ifelse=required_for_multiline
192+
193+
resharper_csharp_accessor_owner_body=expression_body
194+
195+
resharper_redundant_case_label_highlighting=do_not_show
196+
resharper_redundant_argument_default_value_highlighting=do_not_show
197+
resharper_explicit_caller_info_argument_highlighting=hint
198+
199+
dotnet_diagnostic.IDE0057.severity = none
200+
201+
[*.{sh,bat,ps1}]
202+
trim_trailing_whitespace=true
203+
insert_final_newline=true
204+
205+
[*.sh]
206+
end_of_line = lf
207+
208+
[{LICENSE,NOTICE}]
209+
end_of_line = lf

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "*.*.*"
9+
10+
permissions:
11+
contents: read
12+
packages: write
13+
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
pages: write
19+
id-token: write
20+
environment:
21+
name: github-pages
22+
url: ${{steps.deployment.outputs.page_url}}
23+
steps:
24+
- id: repo-basename
25+
run: 'echo "value=`basename ${{ github.repository }}`" >> $GITHUB_OUTPUT'
26+
- uses: actions/checkout@v4
27+
- name: Setup Pages
28+
id: pages
29+
uses: actions/[email protected]
30+
- name: Build documentation
31+
uses: elastic/docs-builder@main
32+
with:
33+
prefix: '${{ steps.repo-basename.outputs.value }}'
34+
- name: Upload artifact
35+
uses: actions/[email protected]
36+
with:
37+
path: .artifacts/docs/html
38+
39+
- name: Deploy artifact
40+
id: deployment
41+
uses: actions/[email protected]

.github/workflows/pr.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
packages: read
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
13+
14+
jobs:
15+
docs:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: elastic/docs-builder@main
20+
name: Build documentation

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.artifacts

.vscode/tasks.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "Build Documentation (Incremental)",
8+
"type": "shell",
9+
"command": "docker run -v \"./.git:/app/.git\" -v \"./docs:/app/docs\" -v \"./.artifacts:/app/.artifacts\" ghcr.io/elastic/docs-builder:edge",
10+
"problemMatcher": [],
11+
"group": {
12+
"kind": "build",
13+
"isDefault": true
14+
}
15+
},
16+
{
17+
"label": "Serve Documentation",
18+
"type": "shell",
19+
"command": "docker run -v \"./.git:/app/.git\" -v \"./docs:/app/docs\" -v \"./.artifacts:/app/.artifacts\" --expose 8080 ghcr.io/elastic/docs-builder:edge serve",
20+
"problemMatcher": [],
21+
"group": {
22+
"kind": "build",
23+
"isDefault": true
24+
}
25+
}
26+
]
27+
}

docs/source/_ext/rejoin.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
from __future__ import annotations
2+
from docutils import nodes
3+
4+
from sphinx.application import Sphinx
5+
from sphinx.util.docutils import SphinxDirective, SphinxRole, directives
6+
from sphinx.util.typing import ExtensionMetadata
7+
8+
def rejoin_text(text: str, split_by: str, join_by: str) -> str:
9+
return join_by.join(text.lower().split(split_by))
10+
11+
class RejoinRole(SphinxRole):
12+
"""A role to split by a string and rejoin by another string !"""
13+
14+
def run(self) -> tuple[list[nodes.Node], list[nodes.system_message]]:
15+
node = nodes.inline(text=rejoin_text(self.text, ' ', '-'))
16+
return [node], []
17+
18+
class RejoinDirective(SphinxDirective):
19+
"""A directive to split by a string and rejoin by another string !"""
20+
21+
required_arguments = 1
22+
has_content = True
23+
FROM_OPTION = 'from'
24+
TO_OPTION = 'to'
25+
optional_arguments = 2
26+
option_spec = {
27+
FROM_OPTION: directives.unchanged,
28+
TO_OPTION: directives.unchanged
29+
}
30+
31+
def run(self) -> list[nodes.Node]:
32+
label = self.arguments[0]
33+
text = ''.join(self.content)
34+
fr = self.options[self.FROM_OPTION]
35+
to = self.options[self.TO_OPTION]
36+
rejoined_text = rejoin_text(text, fr, to)
37+
converted_text = f"{label} : {rejoined_text}"
38+
paragraph_node = nodes.inline(text=converted_text)
39+
return [paragraph_node]
40+
41+
def setup(app: Sphinx) -> ExtensionMetadata:
42+
app.add_role('rejoin', RejoinRole())
43+
app.add_directive('rejoin', RejoinDirective)
44+
return {
45+
'version': '0.1',
46+
'parallel_read_safe': True,
47+
'parallel_write_safe': True,
48+
}

0 commit comments

Comments
 (0)