Skip to content

Commit 64d6e82

Browse files
committed
Merge branch 'main' into feature/synonyms_as_code
# Conflicts: # config/synonyms.yml
2 parents 6cbce2b + 5b75f72 commit 64d6e82

File tree

57 files changed

+1691
-26
lines changed

Some content is hidden

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

57 files changed

+1691
-26
lines changed

config/synonyms.yml

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
11
synonyms:
2-
- ".net,.NET,c#,csharp,dotnet,net,NET,DOTNET"
3-
- "esql,es|ql"
4-
- "motlp,managed otlp,Managed OTLP"
5-
- "s3,aws s3,amazon s3"
6-
- "es,elasticsearch"
7-
- "Elastic Learned Sparse EncodeR,elser"
8-
- "ccs,cross cluster search,cross-cluster search,spaghetti"
9-
- "apm,application performance monitoring"
10-
- "ecctl,Elastic Cloud Control"
11-
- "opentelemetry,otel"
12-
- "eck,Elastic Cloud on Kubernetes"
13-
- "ece,Elastic Cloud Enterprise"
14-
- "ELv2,Elastic License v2"
15-
- "kql,Kibana Query Language"
16-
- "ccr,cross-cluster replication,cross cluster replication"
17-
- "ESaaS,Elastic Stack as a service"
18-
- "knn,k-Nearest Neighbors"
19-
- "ech,Elastic Cloud Hosted,ess"
20-
- "aws,amazon"
21-
- "ilm,index lifecycle management"
22-
- "javascript,js,node,nodejs,node.js"
23-
- "edot,elastic distribution of opentelemetry"
24-
- "k8s,kubernetes"
2+
- [ ".net", "c#", "csharp", "dotnet", "net" ]
3+
- [ "esql", "es|ql" ]
4+
- [ "motlp", "managed otlp" ]
5+
- [ "s3", "aws s3", "amazon s3" ]
6+
- [ "es", "elasticsearch" ]
7+
- [ "elastic learned sparse encoder", "elser" ]
8+
- [ "ccs", "cross cluster search", "cross-cluster search", "spaghetti" ]
9+
- [ "cps", "cross project search", "cross-project search" ]
10+
- [ "apm", "application performance monitoring" ]
11+
- [ "ecctl", "elastic cloud control" ]
12+
- [ "opentelemetry", "otel" ]
13+
- [ "elastic distributions of opentelemetry", "edot" ]
14+
- [ "eck", "elastic cloud on kubernetes" ]
15+
- [ "ece", "elastic cloud enterprise" ]
16+
- [ "elv2", "elastic license v2" ]
17+
- [ "kql", "kibana query language" ]
18+
- [ "ccr", "cross-cluster replication", "cross cluster replication" ]
19+
- [ "esaas", "elastic stack as a service" ]
20+
- [ "knn", "k-nearest neighbors" ]
21+
- [ "ech", "elastic cloud hosted", "ess" ]
22+
- [ "elasticsearch service", "elastic cloud" ]
23+
- [ "aws", "amazon" ]
24+
- [ "gcp", "google cloud platform" ]
25+
- [ "ilm", "index lifecycle management" ]
26+
- [ "javascript", "js", "node", "nodejs", "node.js" ]
27+
- [ "edot", "elastic distribution of opentelemetry" ]
28+
- [ "k8s", "kubernetes" ]
29+
- [ "ecs", "elastic common schema" ]
30+
- [ "ml", "machine learning" ]
31+
- [ "eis", "elastic inference service" ]
32+
- [ "traffic filter", "network security" ]

docs/_docset.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ toc:
103103
- file: icons.md
104104
- file: images.md
105105
- file: kbd.md
106+
- file: math.md
106107
- file: lists.md
107108
- file: line_breaks.md
108109
- file: links.md

docs/syntax/directives.md

Lines changed: 1 addition & 0 deletions

docs/syntax/math.md

Lines changed: 141 additions & 0 deletions

src/Elastic.Documentation.Site/Assets/main.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,67 @@ import { initTabs } from './tabs'
1010
import { initTocNav } from './toc-nav'
1111
import 'htmx-ext-head-support'
1212
import 'htmx-ext-preload'
13+
import katex from 'katex'
14+
import 'katex/dist/katex.min.css'
1315
import { $, $$ } from 'select-dom'
1416
import { UAParser } from 'ua-parser-js'
1517

1618
const { getOS } = new UAParser()
1719
const isLazyLoadNavigationEnabled =
1820
$('meta[property="docs:feature:lazy-load-navigation"]')?.content === 'true'
1921

22+
/**
23+
* Initialize KaTeX math rendering for elements with class 'math'
24+
*/
25+
function initMath() {
26+
const mathElements = $$('.math')
27+
mathElements.forEach((element) => {
28+
try {
29+
const content = element.textContent?.trim()
30+
if (!content) return
31+
32+
// Determine if this is display math based on content and element type
33+
const isDisplayMath =
34+
element.tagName === 'DIV' ||
35+
content.includes('\\[') ||
36+
content.includes('$$') ||
37+
content.includes('\\begin{') ||
38+
content.includes('\n')
39+
40+
// Clean up common LaTeX delimiters
41+
const cleanContent = content
42+
.replace(/^\$\$|\$\$$/g, '') // Remove $$ delimiters
43+
.replace(/^\\\[|\\\]$/g, '') // Remove \[ \] delimiters
44+
.trim()
45+
46+
// Clear the element content before rendering
47+
element.innerHTML = ''
48+
49+
katex.render(cleanContent, element, {
50+
throwOnError: false,
51+
displayMode: isDisplayMath,
52+
strict: false, // Allow some LaTeX extensions
53+
trust: false, // Security: don't trust arbitrary commands
54+
output: 'mathml', // Only render MathML, not HTML
55+
macros: {
56+
// Add common macros if needed
57+
},
58+
})
59+
} catch (error) {
60+
console.warn('KaTeX rendering error:', error)
61+
// Fallback: keep the original content
62+
element.innerHTML = element.textContent || ''
63+
}
64+
})
65+
}
66+
2067
document.addEventListener('htmx:load', function (event) {
2168
initTocNav()
2269
initHighlight()
2370
initCopyButton()
2471
initTabs()
2572
initAppliesSwitch()
73+
initMath()
2674

2775
// We do this so that the navigation is not initialized twice
2876
if (isLazyLoadNavigationEnabled) {

src/Elastic.Documentation.Site/Assets/styles.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,7 @@ body {
224224
user-select: none;
225225
pointer-events: none;
226226
}
227+
228+
math {
229+
margin-top: 1.5rem;
230+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)