Skip to content

Commit 5b03b2c

Browse files
committed
update style guide
1 parent 7ed25ba commit 5b03b2c

File tree

11 files changed

+101
-136
lines changed

11 files changed

+101
-136
lines changed

contribute/style-guide.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,29 @@ Begin every new markdown document with YAML front-matter:
1010

1111
```markdown
1212
---
13-
title: Using a clickhouse-local database
14-
sidebar_label: Using clickhouse-local database
13+
title: 'Using a clickhouse-local database'
14+
sidebar_label: 'Using clickhouse-local database'
1515
slug: /chdb/guides/clickhouse-local
16-
description: Learn how to use a clickhouse-local database with chDB
17-
keywords: [chdb, clickhouse-local]
16+
description: 'Learn how to use a clickhouse-local database with chDB'
17+
keywords: ['chdb', 'clickhouse-local']
1818
---
1919
```
2020

21+
### Associated markdown rule or CI check
22+
23+
#### front-matter validation
24+
25+
There is a custom Docusaurus plugin which runs on build that makes the following
26+
checks on front-matter:
27+
28+
- title, description and slug are specified.
29+
- keywords use flow style arrays with single quoted items e.g.
30+
`keywords: ['integrations']`
31+
- single quotes are used for title, description, slug, sidebar_label
32+
- there is an empty line after the YAML frontmatter block
33+
34+
For implementation details see [plugins/frontmatter-validation](https://github.com/ClickHouse/clickhouse-docs/tree/main/plugins/frontmatter-validation)
35+
2136
## Explicit header tags
2237

2338
Due to the way our translation system works, it is necessary to add an explicit
@@ -191,4 +206,12 @@ export function Anchor(props) {
191206
```
192207
- Replace `<span id="some-id"></span>` with `Anchor id="some-id"/>`
193208

209+
### Dangling pages
210+
211+
In order to prevent pages from becoming 'floating' or 'orphaned' it is
212+
necessary that you add a newly created page to `sidebars.js`. We have a [custom
213+
docusaurus plugin](plugins/checkFloatingPages.js) to catch dangling pages.
214+
215+
If there is some specific reason that you need to bypass this check, you can
216+
add an exception to `floating-pages-exceptions.txt` in the plugins directory.
194217

docs/cloud/reference/changelog.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import fast_releases from '@site/static/images/cloud/reference/june-13-fast-rele
2727
import share_queries from '@site/static/images/cloud/reference/may-30-share-queries.png';
2828
import query_endpoints from '@site/static/images/cloud/reference/may-17-query-endpoints.png';
2929

30-
3130
In addition to this ClickHouse Cloud changelog, please see the [Cloud Compatibility](/cloud/reference/cloud-compatibility.md) page.
3231
## March 7, 2025 {#march-7-2025}
3332

@@ -305,7 +304,7 @@ Services are available in GCP `us-central-1` to customers with the **Dedicated**
305304

306305
We recently announced the Private Preview for Compute-Compute Separation for AWS. We're happy to announce that it is now available for GCP and Azure.
307306

308-
Compute-compute separation allows you to designate specific services as read-write or read-only services, allowing you to design the optimal compute configuration for your application to optimize cost and performance. Please [read the docs](/cloud/reference/compute-compute-separation) for more details.
307+
Compute-compute separation allows you to designate specific services as read-write or read-only services, allowing you to design the optimal compute configuration for your application to optimize cost and performance. Please [read the docs](/cloud/reference/warehouses) for more details.
309308

310309
### Self-service MFA recovery codes {#self-service-mfa-recovery-codes}
311310

@@ -357,7 +356,7 @@ Please also check out our [Trust Center](https://trust.clickhouse.com/) for secu
357356

358357
For existing ClickHouse Cloud services, replicas handle both reads and writes, and there is no way to configure a certain replica to handle only one kind of operation. We have an upcoming new feature called Compute-compute separation that allows you to designate specific services as read-write or read-only services, allowing you to design the optimal compute configuration for your application to optimize cost and performance.
359358

360-
Our new compute-compute separation feature enables you to create multiple compute node groups, each with its own endpoint, that are using the same object storage folder, and thus, with the same tables, views, etc. Read more about [Compute-compute separation here](/cloud/reference/compute-compute-separation). Please [contact support](https://clickhouse.com/support/program) if you would like access to this feature in Private Preview.
359+
Our new compute-compute separation feature enables you to create multiple compute node groups, each with its own endpoint, that are using the same object storage folder, and thus, with the same tables, views, etc. Read more about [Compute-compute separation here](/cloud/reference/warehouses). Please [contact support](https://clickhouse.com/support/program) if you would like access to this feature in Private Preview.
361360

362361
<img alt="Example architecture for compute-compute separation"
363362
style={{width: '600px'}}

docs/cloud/reference/compute-compute-separation.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/cloud/reference/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This section acts as a reference guide for some of the more technical details of
1414
|-----------------------------------|-----------------------------------------------------------------------------------------------------------|
1515
| [Architecture](/cloud/reference/architecture) | Discusses the architecture of ClickHouse Cloud, including storage, compute, administration, and security. |
1616
| [SharedMergeTree](/cloud/reference/shared-merge-tree) | Explainer on SharedMergeTree, the cloud-native replacement for the ReplicatedMergeTree and analogues. |
17-
| [Warehouses](/cloud/reference/compute-compute-separation) | Explainer on what Warehouses and Compute-Compute separation are in ClickHouse Cloud. |
17+
| [Warehouses](/cloud/reference/warehouses) | Explainer on what Warehouses and Compute-Compute separation are in ClickHouse Cloud. |
1818
| [BYOC (Bring Your Own Cloud)](/cloud/reference/byoc)| Explainer on the Bring Your Own Cloud (BYOC) service available with ClickHouse Cloud. |
1919
| [Changelogs](/cloud/reference/changelogs) | Cloud Changelogs and Release Notes. |
2020
| [Cloud Compatibility](/whats-new/cloud-compatibility) | A guide to what to expect functionally and operationally in ClickHouse Cloud. |

docs/interfaces/native-clients-and-interfaces-index.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/whats-new/changelog/index.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
2+
description: 'Changelog for 2025'
3+
note: 'This file is autogenerated by the yarn new-build'
24
slug: /whats-new/changelog/
35
sidebar_position: 2
4-
sidebar_label: 2025
5-
title: 2025 Changelog
6-
note: This file is autogenerated by the yarn new-build
6+
sidebar_label: '2025'
7+
title: '2025 Changelog'
78
---
89

910
### Table of Contents

docusaurus.config.en.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import fixLinks from "./src/hooks/fixLinks.js";
66
const { customParseFrontMatter } = require('./plugins/frontmatter-validation/customParseFrontMatter');
77
const checkFloatingPages = require('./plugins/checkFloatingPages');
88
const frontmatterValidator = require('./plugins/frontmatter-validation/frontmatterValidatorPlugin');
9+
const path = require('path');
10+
911
// Helper function to skip over index.md files.
1012
function skipIndex(items) {
1113
return items.filter(({ type, id }) => {
@@ -328,6 +330,7 @@ const config = {
328330
checkFloatingPages,
329331
{
330332
failBuild: true,
333+
exceptionsFile: path.resolve(__dirname, 'plugins/floating-pages-exceptions.txt')
331334
},
332335
]
333336
],

plugins/checkFloatingPages.js

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,39 @@ const { promisify } = require('util');
44
const glob = promisify(require('glob'));
55
const matter = require('gray-matter');
66

7-
async function checkFloatingPages(context, options) {
7+
async function checkFloatingPages(context, options = {}) {
88
return {
99
name: 'check-floating-pages',
1010

1111
async postBuild({ siteConfig, routesPaths, outDir, head }) {
1212
const { baseUrl } = siteConfig;
1313
const docsDir = path.resolve(context.siteDir, 'docs');
1414

15+
// Read exceptions file if provided
16+
let exceptions = [];
17+
if (options.exceptionsFile && fs.existsSync(options.exceptionsFile)) {
18+
try {
19+
const fileContent = fs.readFileSync(options.exceptionsFile, 'utf-8');
20+
exceptions = fileContent
21+
.split('\n')
22+
.map(line => line.trim())
23+
.filter(line => line && !line.startsWith('#')); // Skip empty lines and comments
24+
25+
// Normalize exceptions paths
26+
exceptions = exceptions.map(exception => {
27+
// Remove leading /docs/ if present
28+
let normalized = exception.replace(/^\/docs\//, '');
29+
// Remove .md extension if present
30+
normalized = normalized.replace(/\.md$/, '');
31+
return normalized;
32+
});
33+
34+
console.log(`Loaded ${exceptions.length} exceptions from ${options.exceptionsFile}`);
35+
} catch (err) {
36+
console.error("Error reading exceptions file:", err);
37+
}
38+
}
39+
1540
let sidebarItems = [];
1641
let autogeneratedDirs = [];
1742
const sidebarsPath = path.join(context.siteDir, 'sidebars.js');
@@ -47,6 +72,16 @@ async function checkFloatingPages(context, options) {
4772

4873
const idToCheck = data.id || relativePath;
4974

75+
// Skip if the page is in the exceptions list
76+
if (exceptions.includes(idToCheck) ||
77+
exceptions.includes(relativePath) ||
78+
exceptions.includes(relativePath + '.md') ||
79+
exceptions.includes('/docs/' + relativePath) ||
80+
exceptions.includes('/docs/' + relativePath + '.md')) {
81+
console.log(`Skipping excepted page: ${relativePath}`);
82+
continue;
83+
}
84+
5085
// Check various ways this document could be included in the sidebar
5186
if (isDocumentIncluded(idToCheck, relativePath, sidebarItems, autogeneratedDirs)) {
5287
continue;

plugins/floating-pages-exceptions.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# List of pages to exclude from floating pages check
2+
# One path per line. Lines starting with # are comments
3+
# Paths can be in any of these formats:
4+
# - Relative to docs directory: integrations/language-clients/java/client-v1
5+
# - With .md extension: integrations/language-clients/java/client-v1.md
6+
# - With /docs/ prefix: /docs/integrations/language-clients/java/client-v1
7+
# - With /docs/ prefix and .md extension: /docs/integrations/language-clients/java/client-v1.md
8+
9+
# Root index page
10+
/docs/index.md
11+
12+
# Java client documentation
13+
integrations/language-clients/java/client-v1
14+
integrations/language-clients/java/jdbc-v1

scripts/autogenerate-table-of-contents.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ python3 scripts/table-of-contents-generator/toc_gen.py --single-toc --dir="docs/
3333
python3 scripts/table-of-contents-generator/toc_gen.py --single-toc --dir="docs/chdb/guides" --md="docs/chdb/guides/index.md" --ignore images
3434
python3 scripts/table-of-contents-generator/toc_gen.py --single-toc --dir="docs/cloud/manage/jan2025_faq" --md="docs/cloud/manage/jan2025_faq/index.md" --ignore images
3535
python3 scripts/table-of-contents-generator/toc_gen.py --single-toc --dir="docs/cloud/changelogs" --md="docs/cloud/reference/release-notes-index.md"
36+
python3 scripts/table-of-contents-generator/toc_gen.py --single-toc --dir="docs/cloud/manage/api" --md="docs/cloud/manage/api/api-reference-index.md"
3637
deactivate
3738
rm -r venv

0 commit comments

Comments
 (0)