Skip to content

Commit c785aec

Browse files
committed
display on scroll working
1 parent 58d281f commit c785aec

File tree

6 files changed

+178
-114
lines changed

6 files changed

+178
-114
lines changed

docs/cloud/get-started/cloud-quick-start.md renamed to docs/cloud/get-started/cloud-quick-start.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ import SQLConsoleDetail from '@site/docs/_snippets/_launch_sql_console.md';
2727
The quickest and easiest way to get up and running with ClickHouse is to create a new
2828
service in [ClickHouse Cloud](https://console.clickhouse.cloud).
2929

30-
## 1. Create a ClickHouse service {#1-create-a-clickhouse-service}
30+
<VerticalStepper type="numbered">
31+
32+
## Create a ClickHouse service {#1-create-a-clickhouse-service}
3133

3234
To create a free ClickHouse service in [ClickHouse Cloud](https://console.clickhouse.cloud), you just need to sign up by completing the following steps:
3335

@@ -67,22 +69,20 @@ Users can customize the service resources if required, specifying a minimum and
6769

6870
Congratulations! Your ClickHouse Cloud service is up and running and onboarding is complete. Keep reading for details on how to start ingesting and querying your data.
6971

70-
## 2. Connect to ClickHouse {#2-connect-to-clickhouse}
72+
## Connect to ClickHouse {#2-connect-to-clickhouse}
7173
There are 2 ways to connect to ClickHouse:
7274
- Connect using our web-based SQL console
7375
- Connect with your app
74-
76+
<br/>
7577
### Connect using SQL console {#connect-using-sql-console}
7678

7779
For getting started quickly, ClickHouse provides a web-based SQL console to which you will be redirected on completing onboarding.
7880

7981
<Image img={createservice8} size="md" alt='SQL Console' border/>
80-
<br/>
8182

8283

8384
Create a query tab and enter a simple query to verify that your connection is working:
8485

85-
<br/>
8686
```sql
8787
SHOW databases
8888
```
@@ -104,7 +104,7 @@ Press the connect button from the navigation menu. A modal will open offering th
104104

105105
If you can't see your language client, you may want to check our list of [Integrations](/integrations).
106106

107-
## 3. Add data {#3-add-data}
107+
## Add data {#3-add-data}
108108

109109
ClickHouse is better with data! There are multiple ways to add data and most of them are available on the Data Sources page, which can be accessed in the navigation menu.
110110

@@ -322,6 +322,8 @@ Suppose we have the following text in a CSV file named `data.csv`:
322322
<Image img={new_rows_from_csv} size="md" alt='New rows from CSV file' />
323323
<br/>
324324

325+
</VerticalStepper>
326+
325327
## What's Next? {#whats-next}
326328

327329
- The [Tutorial](/tutorial.md) has you insert 2 million rows into a table and write some analytical queries

docs/getting-started/quick-start.mdx renamed to docs/quick-start.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,21 @@ import TabItem from '@theme/TabItem';
1313
import CodeBlock from '@theme/CodeBlock';
1414
import {VerticalStepper} from '@clickhouse/click-ui/bundled';
1515

16-
Welcome to ClickHouse!
16+
_Welcome to ClickHouse!_
1717

1818
In this quick-start tutorial we'll get you set-up in 8
1919
easy steps. You'll download an appropriate binary for your OS,
2020
learn to run ClickHouse server, and use the ClickHouse client to create a table,
2121
insert data into it and run a query to select that data.
2222

23-
All you'll need to follow along is your laptop, and curl or another command-line
24-
HTTP client to fetch the ClickHouse binary.
23+
All you'll need to follow along is:
24+
- your laptop
25+
- curl or another command-line
26+
HTTP client to fetch the ClickHouse binary
2527

26-
Let's get started, shall we?
28+
_Let's get started, shall we?_
2729

28-
<VStepper type="numbered" allExpanded>
30+
<VerticalStepper type="numbered">
2931

3032
## Download the binary
3133

@@ -378,4 +380,4 @@ technologies that integrate with ClickHouse.
378380
- If you are using a UI/BI visualization tool, view the [user guides for connecting a UI to ClickHouse](/integrations/data-visualization/).
379381
- The user guide on [primary keys](/guides/best-practices/sparse-primary-indexes.md) is everything you need to know about primary keys and how to define them.
380382

381-
</VStepper>
383+
</VerticalStepper>

plugins/remark-custom-blocks.js

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// plugins/remark-custom-blocks.js
2+
// VERSION BEFORE anchorId/slug logic was added
3+
24
const { visit } = require('unist-util-visit');
35

46
// --- Helper Functions ---
@@ -18,28 +20,29 @@ const extractText = (nodes) => {
1820
// --- Main Plugin Function ---
1921
const plugin = (options) => {
2022
const transformer = (tree, file) => {
23+
2124
// Target JSX elements in the AST
2225
visit(tree, 'mdxJsxFlowElement', (node, index, parent) => {
23-
// Look specifically for the <VStepper> tag used in Markdown source
24-
if (node.name === 'VStepper') {
26+
// Look specifically for the <VerticlStepper> tag used in Markdown source (as originally written)
27+
if (node.name === 'VerticalStepper') { // <-- Checks for VerticalStepper from original code
2528
try {
26-
console.log('Processing VStepper tag');
29+
console.log('Processing VStepper tag'); // Log from original code
2730

2831
// --- 1. Parse <VStepper> Attributes ---
2932
const jsxAttributes = node.attributes || [];
3033
let type = "numbered"; // Default type
31-
let isExpanded = false; // Default not expanded
34+
let isExpanded = false; // Default not expanded (allExpanded)
3235

3336
// Extract attributes
3437
jsxAttributes.forEach(attr => {
3538
if (attr.type === 'mdxJsxAttribute') {
3639
if (attr.name === 'type' && typeof attr.value === 'string') {
3740
type = attr.value;
38-
console.log(`Found type: ${type}`);
41+
console.log(`Found type: ${type}`); // Log from original code
3942
}
40-
else if (attr.name === 'allExpanded') {
43+
else if (attr.name === 'allExpanded') { // Check for allExpanded
4144
isExpanded = true;
42-
console.log('Found allExpanded attribute');
45+
console.log('Found allExpanded attribute'); // Log from original code
4346
}
4447
}
4548
});
@@ -49,26 +52,30 @@ const plugin = (options) => {
4952
let currentStepContent = [];
5053
let currentStepLabel = null;
5154
let currentStepId = null;
55+
// No anchorId variable here
5256

5357
const finalizeStep = () => {
5458
if (currentStepLabel) {
5559
stepsData.push({
56-
id: currentStepId,
57-
label: currentStepLabel,
58-
content: [...currentStepContent], // Collect content AST nodes
60+
id: currentStepId, // step-X ID
61+
label: currentStepLabel, // Plain text label
62+
// No anchorId here
63+
content: [...currentStepContent],
5964
});
60-
console.log(`Finalized step: ${currentStepLabel}`);
65+
console.log(`Finalized step: ${currentStepLabel}`); // Log from original code
6166
}
6267
currentStepContent = [];
68+
currentStepLabel = null; // Reset label
6369
};
6470

6571
if (node.children && node.children.length > 0) {
6672
node.children.forEach((child) => {
6773
if (child.type === 'heading' && child.depth === 2) {
6874
finalizeStep(); // Finalize the previous step first
6975
currentStepLabel = extractText(child.children);
70-
currentStepId = `step-${stepsData.length + 1}`;
71-
console.log(`Found heading: ${currentStepLabel}`);
76+
currentStepId = `step-${stepsData.length + 1}`; // Generate step-X ID
77+
// No anchor extraction here
78+
console.log(`Found heading: ${currentStepLabel}`); // Log from original code
7279
} else if (currentStepLabel) {
7380
// Only collect content nodes *after* a heading has defined a step
7481
currentStepContent.push(child);
@@ -77,36 +84,37 @@ const plugin = (options) => {
7784
}
7885
finalizeStep(); // Finalize the last step found
7986

80-
console.log(`Found ${stepsData.length} steps`);
87+
console.log(`Found ${stepsData.length} steps`); // Log from original code
8188

82-
// --- 3. Transform Parent Node (<VStepper> to <VerticalStepper>) ---
83-
node.name = 'VerticalStepper'; // Use the name expected by MDXComponents mapping
84-
node.children = []; // Clear original children from <VStepper> tag
89+
// --- 3. Transform Parent Node ---
90+
// Transforms to VerticalStepper to match MDXComponents.js
91+
node.name = 'Stepper';
92+
node.children = []; // Clear original children
8593

86-
// Set attributes - using a simple string for expanded mode
94+
// Set attributes - type and expanded (if isExpanded is true)
8795
node.attributes = [
8896
{ type: 'mdxJsxAttribute', name: 'type', value: type },
8997
];
90-
91-
// Add expanded attribute as a string (safer than boolean in MDX)
9298
if (isExpanded) {
9399
node.attributes.push({
94100
type: 'mdxJsxAttribute',
95-
name: 'expanded',
101+
name: 'expanded', // Pass 'expanded' prop to React component
96102
value: 'true'
97103
});
98-
console.log('Added expanded="true" attribute');
104+
console.log('Added expanded="true" attribute'); // Log from original code
99105
}
100106

101107
// --- 4. Generate Child <Step> Nodes ---
102108
stepsData.forEach(step => {
103109
// Basic attributes for Step
104110
const stepAttributes = [
105-
{ type: 'mdxJsxAttribute', name: 'id', value: step.id },
106-
{ type: 'mdxJsxAttribute', name: 'label', value: step.label },
111+
{ type: 'mdxJsxAttribute', name: 'id', value: step.id }, // step-X
112+
{ type: 'mdxJsxAttribute', name: 'label', value: step.label }, // Plain text
113+
// No anchorId attribute
107114
];
108115

109-
// If expanded mode, add a "forceExpanded" attribute to each step
116+
// Add forceExpanded attribute if parent was expanded
117+
// (Matches React prop name used before anchor logic)
110118
if (isExpanded) {
111119
stepAttributes.push({
112120
type: 'mdxJsxAttribute',
@@ -118,14 +126,15 @@ const plugin = (options) => {
118126
// Push the Step node
119127
node.children.push({
120128
type: 'mdxJsxFlowElement',
121-
name: 'Step',
129+
name: 'Step', // Output Step tag
122130
attributes: stepAttributes,
123-
children: step.content,
131+
children: step.content, // Pass content nodes as children
124132
});
125-
console.log(`Added step: ${step.label}`);
133+
console.log(`Added step: ${step.label}`); // Log from original code
126134
});
127135
} catch (error) {
128136
const filePath = file?.path || 'unknown file';
137+
// Added error logging
129138
console.error(`Error processing <VStepper> in ${filePath}:`, error);
130139
}
131140
}

sidebars.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const sidebars = {
1414
link: { type: "doc", id: "introduction-index" },
1515
items: [
1616
"intro",
17-
"getting-started/quick-start",
17+
"quick-start",
1818
"tutorial",
1919
"getting-started/install",
2020
"deployment-modes",

0 commit comments

Comments
 (0)