Skip to content

Commit b77890e

Browse files
committed
Merge branch 'main' into doc-645/glossary-component
2 parents dd55d06 + 5d14fab commit b77890e

File tree

18 files changed

+191
-143
lines changed

18 files changed

+191
-143
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: existence
2+
message: "Admonitions inside <Step> components must have zero indentation to avoid MDX parsing errors"
3+
level: error
4+
scope: raw
5+
nonword: true
6+
tokens:
7+
# This pattern specifically matches indented admonitions that appear within <Step> components
8+
# It captures the indented ::: line itself, which will position the error correctly
9+
- '(?ms)^(?=.*<Step[^>]*>)(?=.*</Step>)[ \t]+:::(note|tip|info|warning|danger|caution|important|success)\b'

.github/workflows/linear-pr-comments.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Linear PR Comments
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
types: [opened, edited]
66
branches:
77
- main
@@ -23,6 +23,6 @@ jobs:
2323
pr-number: ${{ github.event.pull_request.number }}
2424
repo-owner: ${{ github.repository_owner }}
2525
repo-name: ${{ github.event.repository.name }}
26-
github-token: ${{ secrets.GH_ACCESS_TOKEN }}
26+
github-token: ${{ secrets.GITHUB_TOKEN }}
2727
linear-token: ${{ secrets.LINEAR_API_KEY }}
2828
timeout-minutes: 3

.github/workflows/validate-glossary.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,30 @@ on:
44
pull_request:
55
branches: [ main ]
66
paths:
7-
- 'docs/**/*.mdx'
8-
- 'vcluster/**/*.mdx'
9-
- 'platform/**/*.mdx'
7+
- '**/*.mdx'
108
- 'src/data/glossary.yaml'
119
- 'src/components/GlossaryTerm/**'
12-
10+
- 'scripts/validate-glossary-terms.js'
11+
1312
# Allow manual triggering
1413
workflow_dispatch:
1514

1615
jobs:
1716
validate-glossary:
1817
runs-on: ubuntu-latest
19-
18+
2019
steps:
2120
- name: Checkout code
2221
uses: actions/checkout@v3
23-
22+
2423
- name: Setup Node.js
2524
uses: actions/setup-node@v3
2625
with:
27-
node-version: '18'
26+
node-version: '20'
2827
cache: 'npm'
29-
28+
3029
- name: Install dependencies
31-
run: npm ci
32-
30+
run: npm install
31+
3332
- name: Validate glossary terms
3433
run: npm run validate-glossary

docs/index.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ hide_table_of_contents: false
66
---
77

88
import PartialWhatAreVirtualClusters from '../vcluster/_partials/what-are-virtual-clusters.mdx'
9-
import GlossaryTerm from '@site/src/components/GlossaryTerm'
109

11-
<PartialWhatAreVirtualClusters />
10+
<PartialWhatAreVirtualClusters />

platform/administer/connector/database.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import VersionBadge from '@site/src/components/VersionBadge';
1616
The database connector feature allows an admin to configure a database server to manage backing stores for multiple virtual clusters. For each virtual cluster, the feature automatically creates an independent database and non-privileged user. Read more about the use of external databases in the [External Database documentation](/docs/vcluster/configure/vcluster-yaml/control-plane/components/backing-store/database/external).
1717

1818
:::note
19-
This feature currently only supports MySQL database servers. It has been extensively tested for AWS RDS MySQL compatibility.
19+
This feature only supports MySQL and PostgreSQL database servers. It has been extensively tested for AWS RDS and Aurora compatibility.
2020
:::
2121

2222
## Prerequisites
@@ -79,19 +79,20 @@ Modifying a database secret to point to a different database server is not recom
7979

8080
### Example configuration
8181

82-
The following example is a connector secret for the shared database feature. It is configured for an internal instance of MySQL that is exposed with a ClusterIP service named `mysql` in the `vcluster-platform` namespace (assume this is the namespace the platform is installed in). This could instead be any other endpoint, such as an AWS RDS MySQL endpoint.
82+
The following example shows a connector secret for the shared database feature. It connects to an internal MySQL instance exposed by a service named `mysql` in the `vcluster-platform` namespace (where the platform is assumed to be installed). You can also use any other MySQL-compatible endpoint, such as an AWS RDS instance.
8383

8484
```yaml title="Shared database secret example"
8585
apiVersion: v1
8686
kind: Secret
8787
metadata:
8888
name: default-data-source
89-
namespace: vcluster-platform # this must match the namespace that vCluster Platform is in
89+
namespace: vcluster-platform # This must match the namespace that vCluster Platform is in.
9090
labels:
9191
loft.sh/connector-type: "shared-database"
9292
stringData:
93-
endpoint: mysql.vcluster-platform # this service could be in any namespace
93+
endpoint: mysql.vcluster-platform # This service can be in any namespace.
9494
password: <password>
9595
port: "3306"
9696
user: root
97+
type: mysql # This can be mysql or postgres. If left blank, the mysql database type is assumed.
9798
```

platform/configure/domain.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ ingress:
254254
If you want to [configure the platform with additionalCA](/platform/configure/config.mdx#using-a-custom-certificate-authority), the Certificate Authority used for signing this certificate has to be added as a base64 encoded value:
255255
256256
```bash title="Encode CA certificate"
257-
cat ca.crt | base64 -d
257+
cat ca.crt | base64
258258
```
259259

260260
Use this output in the `.additionalCA` helm value.
@@ -403,7 +403,7 @@ kubectl create secret generic tls-vcluster-platform -n vcluster-platform --type=
403403
If you want to [configure the platform with additionalCA](/platform/configure/config.mdx#using-a-custom-certificate-authority), use:
404404

405405
```bash title="Encode CA certificate"
406-
cat ca.crt | base64 -d
406+
cat ca.crt | base64
407407
```
408408

409409
as an input for the `.additionalCA` helm value.

platform/reference/glossary.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ description: Glossary of terms used in the platform documentation
77

88
import glossaryData from '@site/src/data/glossary.yaml';
99

10+
<!-- vale off -->
1011
# Platform glossary {#platform-glossary}
12+
<!-- vale on -->
1113

1214
This page contains definitions for common terms used throughout the platform documentation.
1315

@@ -24,7 +26,7 @@ This page contains definitions for common terms used throughout the platform doc
2426
<p><strong>Related terms:</strong> {entry.related.map((term, index) => (
2527
<span key={term}>
2628
{index > 0 && ', '}
27-
<a href={`#${term}`}>{glossaryData[term]?.term || term}</a>
29+
<span>{glossaryData[term]?.term || term}</span>
2830
</span>
2931
))}</p>
3032
)}

platform_versioned_docs/version-4.2.0/configure/domain.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ ingress:
254254
If you want to [configure the platform with additionalCA](/platform/configure/config.mdx#using-a-custom-certificate-authority), the Certificate Authority used for signing this certificate has to be added as a base64 encoded value:
255255
256256
```bash title="Encode CA certificate"
257-
cat ca.crt | base64 -d
257+
cat ca.crt | base64
258258
```
259259

260260
Use this output in the `.additionalCA` helm value.
@@ -403,7 +403,7 @@ kubectl create secret generic tls-vcluster-platform -n vcluster-platform --type=
403403
If you want to [configure the platform with additionalCA](/platform/configure/config.mdx#using-a-custom-certificate-authority), use:
404404

405405
```bash title="Encode CA certificate"
406-
cat ca.crt | base64 -d
406+
cat ca.crt | base64
407407
```
408408

409409
as an input for the `.additionalCA` helm value.

scripts/validate-glossary-terms.js

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,28 @@ const glossaryData = yaml.load(fs.readFileSync(glossaryPath, 'utf8'));
2424
const glossaryTermPattern = /<GlossaryTerm\s+term=["']([^"']+)["']/g;
2525

2626
// Get all MDX files
27-
const mdxFiles = [
28-
...glob.sync('docs/**/*.mdx'),
29-
...glob.sync('vcluster/**/*.mdx'),
30-
...glob.sync('platform/**/*.mdx'),
31-
];
27+
// Handle both glob v7 and v10 formats
28+
let mdxFiles = [];
29+
try {
30+
// For glob v7
31+
mdxFiles = glob.sync('**/*.mdx', {
32+
ignore: [
33+
'node_modules/**',
34+
'build/**',
35+
'.docusaurus/**',
36+
'.vscode/**'
37+
]
38+
});
39+
} catch (error) {
40+
// For newer versions, fall back to the directory-specific approach
41+
mdxFiles = [
42+
...glob.sync('docs/**/*.mdx'),
43+
...glob.sync('vcluster/**/*.mdx'),
44+
...glob.sync('platform/**/*.mdx'),
45+
...glob.sync('platform_versioned_docs/**/*.mdx'),
46+
...glob.sync('vcluster_versioned_docs/**/*.mdx'),
47+
];
48+
}
3249

3350
let hasErrors = false;
3451

src/components/GlossaryTerm/index.jsx

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,22 @@ import React from 'react';
22
import styles from './styles.module.css';
33
import glossaryData from '@site/src/data/glossary.yaml';
44

5-
// Track terms used per page
6-
const usedTerms = {};
7-
85
const GlossaryTerm = ({ term, children }) => {
9-
// Get current page path
10-
const pagePath = typeof window !== 'undefined' ? window.location.pathname : 'default';
11-
12-
// Initialize page tracking if needed
13-
if (!usedTerms[pagePath]) {
14-
usedTerms[pagePath] = new Set();
15-
}
166

177
// Get term data
188
const termData = glossaryData[term];
199

20-
// Check if first occurrence
21-
const isFirstOccurrence = !usedTerms[pagePath].has(term);
22-
23-
// Mark as used if valid
24-
if (isFirstOccurrence && termData) {
25-
usedTerms[pagePath].add(term);
26-
}
27-
2810
// Handle missing term data
2911
if (!termData) {
3012
return <>{children || term}</>;
3113
}
3214

33-
// If not first occurrence, just render normally
34-
if (!isFirstOccurrence) {
35-
return <>{children || termData.term}</>;
36-
}
37-
3815
// For first occurrence, render with tooltip
3916
const termContent = children || termData.term;
4017
const hasUrl = termData.url && termData.url.length > 0;
4118

4219
return (
43-
<div className={styles.termWrapper}>
20+
<span className={styles.termWrapper}>
4421
{hasUrl ? (
4522
<a href={termData.url} className={styles.term}>
4623
{termContent}
@@ -50,25 +27,39 @@ const GlossaryTerm = ({ term, children }) => {
5027
{termContent}
5128
</span>
5229
)}
53-
<div className={styles.tooltip}>
54-
<div className={styles.tooltipHeader}>
30+
<span className={styles.tooltip}>
31+
<span className={styles.tooltipHeader}>
5532
{hasUrl ? (
5633
<a href={termData.url} className={styles.tooltipHeaderLink}>
5734
{termData.term}
5835
</a>
5936
) : (
6037
termData.term
6138
)}
62-
</div>
63-
<div className={styles.tooltipDefinition}>{termData.definition}</div>
39+
</span>
40+
<span className={styles.tooltipDefinition}>{termData.definition}</span>
6441
{termData.related && (
65-
<div className={styles.related}>
42+
<span className={styles.related}>
6643
<span>Related: </span>
67-
{termData.related.join(', ')}
68-
</div>
44+
{termData.related.map((relatedTermId, index) => {
45+
const relatedTerm = glossaryData[relatedTermId];
46+
return (
47+
<span key={relatedTermId}>
48+
{index > 0 && ', '}
49+
{relatedTerm ? (
50+
<span className={styles.relatedTerm}>
51+
{relatedTerm.term}
52+
</span>
53+
) : (
54+
relatedTermId
55+
)}
56+
</span>
57+
);
58+
})}
59+
</span>
6960
)}
70-
</div>
71-
</div>
61+
</span>
62+
</span>
7263
);
7364
};
7465

0 commit comments

Comments
 (0)