Skip to content

Commit b0b9528

Browse files
committed
update docs
1 parent af62999 commit b0b9528

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

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

contribute/style-guide.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,35 @@ reading the markdown to be able to see the code. The advantage of importing code
150150
to snippets this way is that you can test your snippets externally or store them
151151
wherever you want.
152152

153+
If you want to only import a section from a file, surround the section with `docs-start`
154+
and `docs-end` comments, for example:
155+
156+
```python
157+
a = 200
158+
b = 33
159+
#docs-start
160+
if b > a:
161+
print("b is greater than a")
162+
elif a == b:
163+
print("a and b are equal")
164+
else:
165+
print("a is greater than b")
166+
#docs-end
167+
```
168+
169+
Only the code between those comments will be pulled.
170+
171+
If you want to make multiple code snippets from one file then you can use the `snippet` parameter:
172+
173+
```markdown
174+
175+
\```python url=https://raw.githubusercontent.com/ClickHouse/clickhouse-connect/refs/heads/main/examples/pandas_examples.py snippet=1
176+
Code will be inserted here
177+
\```
178+
```
179+
180+
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.
181+
153182
### Highlighting
154183

155184
You can highlight lines in a code block using the following keywords:

0 commit comments

Comments
 (0)