Skip to content

Commit 75b804f

Browse files
committed
Merge branch 'main' of https://github.com/ClickHouse/clickhouse-docs into diataxis-llm
2 parents a907c70 + 9af7100 commit 75b804f

File tree

278 files changed

+6318
-4804
lines changed

Some content is hidden

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

278 files changed

+6318
-4804
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
* @ClickHouse/docs
2-
/docs/integrations/data-ingestion/clickpipes/ @ClickHouse/clickpipes @ClickHouse/docs
32
/docs/integrations/ @ClickHouse/integrations-ecosystem @ClickHouse/docs
3+
/docs/integrations/data-ingestion/clickpipes/ @ClickHouse/clickpipes @ClickHouse/docs

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ Please assign any pull request (PR) against an issue; this helps the docs team t
134134
135135
Check out the GitHub docs for a refresher on [how to create a pull request](https://docs.github.com/en/desktop/working-with-your-remote-repository-on-github-or-github-enterprise/creating-an-issue-or-pull-request-from-github-desktop).
136136
137-
### Style guidelines
137+
### Style and contribution guidelines
138138
139-
For documentation style guidelines, see ["Style guide"](/contribute/style-guide.md).
139+
For documentation style guidelines, see ["Style guide"](/contribute/style-guide.md).
140140
141141
To check spelling and markdown is correct locally run:
142142
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
receivers:
2+
filelog:
3+
include:
4+
- /opt/data/logs/access-unstructured.log
5+
start_at: beginning
6+
operators:
7+
- type: regex_parser
8+
regex: '^(?P<ip>[\d.]+)\s+-\s+-\s+\[(?P<timestamp>[^\]]+)\]\s+"(?P<method>[A-Z]+)\s+(?P<url>[^\s]+)\s+HTTP/[^\s]+"\s+(?P<status>\d+)\s+(?P<size>\d+)\s+"(?P<referrer>[^"]*)"\s+"(?P<user_agent>[^"]*)"'
9+
timestamp:
10+
parse_from: attributes.timestamp
11+
layout: '%d/%b/%Y:%H:%M:%S %z'
12+
#22/Jan/2019:03:56:14 +0330
13+
processors:
14+
batch:
15+
timeout: 1s
16+
send_batch_size: 100
17+
memory_limiter:
18+
check_interval: 1s
19+
limit_mib: 2048
20+
spike_limit_mib: 256
21+
exporters:
22+
# HTTP setup
23+
otlphttp/hdx:
24+
endpoint: 'http://localhost:4318'
25+
headers:
26+
authorization: <YOUR_INGESTION_API_KEY>
27+
compression: gzip
28+
29+
# gRPC setup (alternative)
30+
otlp/hdx:
31+
endpoint: 'localhost:4317'
32+
headers:
33+
authorization: <YOUR_API_INGESTION_KEY>
34+
compression: gzip
35+
service:
36+
telemetry:
37+
metrics:
38+
address: 0.0.0.0:9888 # Modified as 2 collectors running on same host
39+
pipelines:
40+
logs:
41+
receivers: [filelog]
42+
processors: [batch]
43+
exporters: [otlphttp/hdx]

contribute/style-guide.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,75 @@ SELECT * FROM system.contributors;
112112
\```
113113
```
114114

115+
Note: in the snippet above `\` is used only for formatting purposes in this guide.
116+
You should not include it when you write markdown.
117+
115118
Code blocks:
116119
- Should always have a language defined immediately next to the opening 3
117120
backticks, without any space.
118121
- Have a title (optional) such as 'Query' or 'Response'
119122
- Use language `response` if it is for the result of a query.
120123

124+
#### Importing code from files or URLs
125+
126+
There are a few additional parameters you can include on a code block if you want
127+
to import code.
128+
129+
To import from a file use `file=`:
130+
131+
```text
132+
\```python file=code_snippets/integrations/example.py
133+
Code will be inserted here
134+
\```
135+
```
136+
137+
When `yarn build` is run, the code from the file will be inserted as text into
138+
the code block.
139+
140+
To import from a url use `url=`:
141+
142+
```text
143+
\```python url=https://raw.githubusercontent.com/ClickHouse/clickhouse-connect/refs/heads/main/examples/pandas_examples.py
144+
Code will be inserted here
145+
\```
146+
```
147+
148+
**File paths are relative to the root of the docs repository**
149+
150+
You should commit the code inserted to the snippet as we want people (or LLMs)
151+
reading the markdown to be able to see the code. The advantage of importing code
152+
to snippets this way is that you can test your snippets externally or store them
153+
wherever you want.
154+
155+
If you want to only import a section from a file, surround the section with `docs-start`
156+
and `docs-end` comments, for example:
157+
158+
```python
159+
a = 200
160+
b = 33
161+
#docs-start
162+
if b > a:
163+
print("b is greater than a")
164+
elif a == b:
165+
print("a and b are equal")
166+
else:
167+
print("a is greater than b")
168+
#docs-end
169+
```
170+
171+
Only the code between those comments will be pulled.
172+
173+
If you want to make multiple code snippets from one file then you can use the `snippet` parameter:
174+
175+
```markdown
176+
177+
\```python url=https://raw.githubusercontent.com/ClickHouse/clickhouse-connect/refs/heads/main/examples/pandas_examples.py snippet=1
178+
Code will be inserted here
179+
\```
180+
```
181+
182+
You will then use `docs-start-1`, `docs-end-1` comments for the first snippet, `docs-start-2`, `docs-end-2` for the second snippet and so on.
183+
121184
### Highlighting
122185

123186
You can highlight lines in a code block using the following keywords:
@@ -412,3 +475,48 @@ vale --filter='.Name == "ClickHouse.Headings"' docs/integrations
412475
This will run only the rule named `Headings` on
413476
the `docs/integrations` directory. Specifying a specific markdown
414477
file is also possible.
478+
479+
## Vertical numbered stepper
480+
481+
It is possible to render numbered steppers, as seen [here](https://clickhouse.com/docs/getting-started/quick-start/cloud)
482+
for example, using the following syntax:
483+
484+
`<VerticalStepper headerLevel="hN"></VerticalStepper>`
485+
486+
For example:
487+
488+
```markdown
489+
<VerticalStepper headerLevel="h2">
490+
## Header 1 {#explicit-anchor-1}
491+
492+
Some content...
493+
494+
## Header 2 {#explicit-anchor-2}
495+
496+
Some more content...
497+
498+
</VerticalStepper>
499+
```
500+
501+
You should specify `N` as the header level you want the vertical stepper to render
502+
for. In the example above, it is `h2` as we are using `##`. Use `h3` for `###`,
503+
`h4` for `####` etc.
504+
505+
The component also works with numbered lists using `headerLevel="list"`. For example:
506+
507+
```markdown
508+
<VerticalStepper headerLevel="h2">
509+
510+
1. First list item
511+
512+
Some content...
513+
514+
2. Second list item
515+
516+
Some more content...
517+
518+
</VerticalStepper>
519+
```
520+
521+
In this case, the first paragraph will be taken to be the label (the text next
522+
to the numbered circles of the vertical stepper) of the stepper.

docs/_snippets/_users-and-roles-common.md

Lines changed: 55 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -42,64 +42,73 @@ Create these tables and users to be used in the examples.
4242

4343
#### Creating a sample database, table, and rows {#creating-a-sample-database-table-and-rows}
4444

45-
1. Create a test database
45+
<VerticalStepper headerLevel="h5">
4646

47-
```sql
48-
CREATE DATABASE db1;
49-
```
47+
##### Create a test database {#create-a-test-database}
5048

51-
2. Create a table
49+
```sql
50+
CREATE DATABASE db1;
51+
```
5252

53-
```sql
54-
CREATE TABLE db1.table1 (
55-
id UInt64,
56-
column1 String,
57-
column2 String
58-
)
59-
ENGINE MergeTree
60-
ORDER BY id;
61-
```
53+
##### Create a table {#create-a-table}
6254

63-
3. Populate the table with sample rows
55+
```sql
56+
CREATE TABLE db1.table1 (
57+
id UInt64,
58+
column1 String,
59+
column2 String
60+
)
61+
ENGINE MergeTree
62+
ORDER BY id;
63+
```
6464

65-
```sql
66-
INSERT INTO db1.table1
67-
(id, column1, column2)
68-
VALUES
69-
(1, 'A', 'abc'),
70-
(2, 'A', 'def'),
71-
(3, 'B', 'abc'),
72-
(4, 'B', 'def');
73-
```
65+
##### Populate the table with sample rows {#populate}
7466

75-
4. Verify the table:
67+
```sql
68+
INSERT INTO db1.table1
69+
(id, column1, column2)
70+
VALUES
71+
(1, 'A', 'abc'),
72+
(2, 'A', 'def'),
73+
(3, 'B', 'abc'),
74+
(4, 'B', 'def');
75+
```
7676

77-
```sql
78-
SELECT *
79-
FROM db1.table1
80-
```
77+
##### Verify the table {#verify}
8178

82-
```response
83-
Query id: 475015cc-6f51-4b20-bda2-3c9c41404e49
79+
```sql title="Query"
80+
SELECT *
81+
FROM db1.table1
82+
```
8483

85-
┌─id─┬─column1─┬─column2─┐
86-
│ 1 │ A │ abc │
87-
│ 2 │ A │ def │
88-
│ 3 │ B │ abc │
89-
│ 4 │ B │ def │
90-
└────┴─────────┴─────────┘
91-
```
84+
```response title="Response"
85+
Query id: 475015cc-6f51-4b20-bda2-3c9c41404e49
9286
93-
5. Create a regular user that will be used to demonstrate restrict access to certain columns:
87+
┌─id─┬─column1─┬─column2─┐
88+
│ 1 │ A │ abc │
89+
│ 2 │ A │ def │
90+
│ 3 │ B │ abc │
91+
│ 4 │ B │ def │
92+
└────┴─────────┴─────────┘
93+
```
9494

95-
```sql
96-
CREATE USER column_user IDENTIFIED BY 'password';
97-
```
95+
##### Create `column_user` {#create-a-user-with-restricted-access-to-columns}
9896

99-
6. Create a regular user that will be used to demonstrate restricting access to rows with certain values:
100-
```sql
101-
CREATE USER row_user IDENTIFIED BY 'password';
102-
```
97+
Create a regular user that will be used to demonstrate restrict access to certain columns:
98+
99+
```sql
100+
CREATE USER column_user IDENTIFIED BY 'password';
101+
```
102+
103+
##### Create `row_user` {#create-a-user-with-restricted-access-to-rows-with-certain-values}
104+
105+
Create a regular user that will be used to demonstrate restricting access to rows with certain values:
106+
107+
```sql
108+
CREATE USER row_user IDENTIFIED BY 'password';
109+
```
110+
111+
</VerticalStepper>
103112

104113
#### Creating roles {#creating-roles}
105114

0 commit comments

Comments
 (0)