Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit b3df1b0

Browse files
authored
Aesthetics (#624)
# Contributor agreement - [x] I have read and agree to the [Contributor Agreement](https://github.com/kuzudb/kuzu-docs/blob/main/CLA.md).
1 parent d4e12ec commit b3df1b0

Some content is hidden

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

66 files changed

+750
-746
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,42 @@ Images are added to `src/assets/` and embedded in Markdown with a relative link.
3737
Any additional static assets (like fonts, favicon, PDFs, etc.) that will not be processed by Astro
3838
are placed in the `public/` directory.
3939

40+
## Customizations
41+
42+
### Table Syntax Highlighting
43+
44+
Add tag "table" after the three backticks to indicate the table custom css style to code block
45+
46+
**Usage:**
47+
```table
48+
┌─────────┬─────────┬─────────┐
49+
│ column1 │ column2 │ column3 │
50+
├─────────┼─────────┼─────────┤
51+
│ value1 │ value2 │ value3 │
52+
└─────────┴─────────┴─────────┘
53+
```
54+
55+
56+
### Tab Synchronization
57+
58+
Include "syncKey=<syncKey_name>" to Tabs tag. To have tabs synchronize, ensure <syncKey_name> are the same across different tabs.
59+
The tabitems do not need to be the same. Identical tabitems will have synchronization applied to them when clicked.
60+
61+
**Usage:**
62+
<Tabs syncKey="langs">
63+
<TabItem label="Python" />
64+
<TabItem label="Rust" />
65+
</Tabs>
66+
67+
<Tabs syncKey="langs">
68+
<TabItem label="C++" />
69+
<TabItem label="Rust" />
70+
<TabItem label="Java" />
71+
</Tabs>
72+
73+
Pressing on "Rust" will result in both tabs switching onto Rust.
74+
75+
4076
## 🧞 Commands
4177

4278
All commands are run from the root of the project, from a terminal:

astro.config.mjs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ export default defineConfig({
9292
tag: 'meta',
9393
attrs: { name: 'twitter:image', content: site + '/img/og.png' },
9494
},
95-
// Script
96-
{
97-
tag: "script",
98-
attrs: { src: "/reb2b.js", type: "text/javascript", async: true }
99-
},
10095
{
10196
tag: "script",
10297
attrs: { src: "/remove-prompt.js", type: "text/javascript" }

public/remove-prompt.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,40 @@
9292
}
9393
})();
9494

95+
// Add user-select: none to spans that start with $
96+
(function () {
97+
function addDollarClass() {
98+
const codeBlocks = document.querySelectorAll('pre[data-language] code > div.ec-line > div.code > span:first-child');
99+
100+
codeBlocks.forEach(span => {
101+
const text = span.textContent || span.innerText;
102+
if (text && text.trim().startsWith('$')) {
103+
span.classList.add('starts-with-dollar');
104+
}
105+
});
106+
}
107+
108+
// Process on page load
109+
if (document.readyState === 'loading') {
110+
document.addEventListener('DOMContentLoaded', addDollarClass);
111+
} else {
112+
addDollarClass();
113+
}
114+
115+
// Process when content changes (for dynamic content)
116+
const observer = new MutationObserver(function(mutations) {
117+
mutations.forEach(function(mutation) {
118+
if (mutation.type === 'childList') {
119+
addDollarClass();
120+
}
121+
});
122+
});
123+
124+
// Observe the entire document for changes
125+
observer.observe(document.body, {
126+
childList: true,
127+
subtree: true
128+
});
129+
})();
130+
95131

src/components/overrides/Header.astro

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { Props } from "@astrojs/starlight/props";
33
import SiteTitle from "@astrojs/starlight/components/SiteTitle.astro";
44
import Search from "@astrojs/starlight/components/Search.astro";
55
import SocialIcons from "@astrojs/starlight/components/SocialIcons.astro";
6-
import ThemeSelect from "./ThemeSelect.astro";
76
import { Icon } from "@astrojs/starlight/components";
87
import Banner from './Banner.astro';
98
import ThemeSelect from './ThemeSelect.astro';
@@ -12,7 +11,7 @@ import ThemeSelect from './ThemeSelect.astro';
1211
<!-- Site Title - shows when sidebars collapse -->
1312
<div class="header-site-title">
1413
<a href="/" class="site-title">
15-
<img src="/src/assets/logo/kuzu-logo-inverse.png" alt="Kuzu" class="site-logo" />
14+
<SiteTitle />
1615
</a>
1716
</div>
1817

src/content/docs/client-apis/cli.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Pipe the file content to the CLI as follows:
183183
```bash
184184
kuzu example.kuzu < schema.cypher
185185
```
186-
```
186+
``` table
187187
Opened the database example.kuzu in read-write mode.
188188
Enter ":help" for usage hints.
189189
┌────────────────────────────────┐

src/content/docs/client-apis/cpp.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Inference rule for c++ type to cypher type is defined as follows:
113113
| std::string | STRING |
114114

115115
#### Example
116-
```
116+
```cpp
117117
// Create a unary scalar function which adds 5 to the input value.
118118
static int32_t add5(int32_t x) {
119119
return x + 5;

src/content/docs/client-apis/python.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ conn.execute("CREATE (a:Person {name: 'Zhang', age: 50})")
239239
result = conn.execute("MATCH (p:Person) RETURN p.*")
240240
print(result.get_as_pl())
241241
```
242-
```
242+
```table
243243
shape: (3, 2)
244244
┌─────────┬───────┐
245245
│ p.name ┆ p.age │
@@ -256,7 +256,7 @@ Return specific columns by name and optionally alias them as follows:
256256
result = conn.execute("MATCH (p:Person) RETURN p.name AS name")
257257
print(result.get_as_pl())
258258
```
259-
```
259+
```table
260260
shape: (3, 1)
261261
┌─────────┐
262262
│ name │
@@ -352,7 +352,7 @@ df = pl.DataFrame({
352352
result = conn.execute("LOAD FROM df RETURN *")
353353
print(result.get_as_pl())
354354
```
355-
```
355+
```table
356356
shape: (3, 2)
357357
┌─────────┬─────┐
358358
│ name ┆ age │
@@ -453,7 +453,7 @@ conn.execute("COPY Person FROM df")
453453
result = conn.execute("MATCH (p:Person) RETURN p.*")
454454
print(result.get_as_pl())
455455
```
456-
```
456+
```table
457457
shape: (3, 2)
458458
┌─────────┬───────┐
459459
│ p.name ┆ p.age │

src/content/docs/concurrency.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ which also connects to the same `example.kuzu`. When you launch Kuzu CLI and poi
101101
`example.kuzu`, Kuzu CLI embeds Kuzu and tries to create a `READ_WRITE` Database object. So if your notebook process already
102102
has created a Database object, this will fail with an error that looks like this:
103103

104-
```
104+
```console
105105
RuntimeError: IO exception: Could not set lock on file : /path/to/database/example.kuzu
106106
```
107107

@@ -208,7 +208,7 @@ application is to use design patterns as per one of the scenarios shown pictoria
208208
Sometimes, when you are working in a Jupyter notebook and building your Kuzu graph while also trying to
209209
open other processes that connect to the same directory as the database file, you may come across this error:
210210

211-
```
211+
```console
212212
RuntimeError: IO exception: Could not set lock on file : /path/to/database/example.kuzu
213213
```
214214

src/content/docs/cypher/attach.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ example. Suppose you are in the Kuzu CLI and have opened a database under local
77
session, you want to query another local Kuzu database, say `/work`, which supposedly has some `Manager` node table.
88
You can attach to the `/work` database and query the `Manager` nodes in it and then detach as follows:
99

10-
```
10+
```cypher
1111
ATTACH '/work' AS work (dbtype kuzu);
1212
MATCH (a:Manager) RETURN *;
1313
DETACH work;

src/content/docs/cypher/data-definition/alter.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,13 @@ COMMENT ON TABLE User IS 'User information';
132132
Comments can be extracted through the `SHOW_TABLES()` function. See [CALL](/cypher/query-clauses/call) for more information.
133133
```cypher
134134
CALL SHOW_TABLES() RETURN *;
135-
--------------------------------------------
136-
| TableName | TableType | TableComment |
137-
--------------------------------------------
138-
| User | NODE | User information |
139-
--------------------------------------------
140-
| City | NODE | |
141-
--------------------------------------------
135+
```
136+
```table
137+
┌───────────┬───────────┬──────────────────┐
138+
│ TableName │ TableType │ TableComment │
139+
├───────────┼───────────┼──────────────────┤
140+
│ User │ NODE │ User information │
141+
│ City │ NODE │ │
142+
└───────────┴───────────┴──────────────────┘
142143
```
143144

0 commit comments

Comments
 (0)