Skip to content

Commit

Permalink
add landing pages for chDB
Browse files Browse the repository at this point in the history
  • Loading branch information
Blargian committed Dec 22, 2024
1 parent 951888b commit ac5d7c2
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 23 deletions.
44 changes: 44 additions & 0 deletions docs/en/chdb/guides/autogen_table_of_contents_guides.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import json
import os

"""
This script is used to automatically generate a table of contents from the guide markdown files.
The table of contents is used in index.md.
It is only necessary to run this script if a new guide .md file has been added to the guides directory.
"""


def extract_title_and_slug(filename):
with open(filename, "r") as f:
lines = f.readlines()

title, slug = None, None
for line in lines:
if line.startswith("title:"):
title = line.strip().split(": ")[1]
elif line.startswith("slug:"):
slug = line.strip().split(": ")[1]
if title and slug:
return {"title": title, "slug": slug}

return None


def main():
json_array = []
current_directory = os.getcwd()
for filename in os.listdir(current_directory):
if filename.endswith(".md") and filename != "index.md":
result = extract_title_and_slug(filename)
if result:
json_array.append(result)

json_array = sorted(json_array, key=lambda x: x["title"])

with open("table_of_contents.json", "w") as f:
json.dump(json_array, f, indent=4)


if __name__ == "__main__":
main()
13 changes: 13 additions & 0 deletions docs/en/chdb/guides/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: chDB Guides
slug: /en/chdb/guides
description: Index page for chDB guides
keywords: [chdb, guides]
---

import TableOfContentsJSON from './table_of_contents.json'
import { TableOfContents } from '/src/components/TableOfContents'

Take a look at our chDB developer guides below:

<TableOfContents items={TableOfContentsJSON} />
30 changes: 30 additions & 0 deletions docs/en/chdb/guides/table_of_contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[
{
"title": "How to query Apache Arrow with chDB",
"slug": "/en/chdb/guides/apache-arrow"
},
{
"title": "How to query Pandas DataFrames with chDB",
"slug": "/en/chdb/guides/pandas"
},
{
"title": "How to query Parquet files",
"slug": "/en/chdb/guides/querying-parquet"
},
{
"title": "How to query a remote ClickHouse server",
"slug": "/en/chdb/guides/query-remote-clickhouse"
},
{
"title": "How to query data in an S3 bucket",
"slug": "/en/chdb/guides/querying-s3"
},
{
"title": "JupySQL and chDB",
"slug": "/en/chdb/guides/jupysql"
},
{
"title": "Using a clickhouse-local database",
"slug": "/en/chdb/guides/clickhouse-local"
}
]
17 changes: 17 additions & 0 deletions docs/en/chdb/install/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Language Integrations Index
slug: /en/chdb/install
description: Index page for chDB language integrations
keywords: [python, NodeJS, Go, Rust, Bun, C, C++]
---

Instructions for how to get setup with chDB are available below for the following languages and runtimes:

| Language |
|----------------------------------------|
| [Python](/docs/en/chdb/install/python) |
| [NodeJS](/docs/en/chdb/install/nodejs) |
| [Go](/docs/en/chdb/install/go) |
| [Rust](/docs/en/chdb/install/rust) |
| [Bun](/docs/en/chdb/install/bun) |
| [C and C++](/docs/en/chdb/install/c) |
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Data Formats
sidebar_label: Data Formats
slug: /en/chdb/data-formats
slug: /en/chdb/reference/data-formats
description: Data Formats for chDB
keywords: [chdb, data formats]
---
Expand Down
11 changes: 11 additions & 0 deletions docs/en/chdb/reference/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: chDB Technical Reference
slug: /en/chdb/reference
description: Data Formats for chDB
keywords: [chdb, data formats]
---

| Reference page |
|---------------------------------------------------|
| [Data Formats](/en/chdb/reference/data-formats) |
| [SQL Reference](/en/chdb/reference/sql-reference) |
22 changes: 22 additions & 0 deletions docs/en/chdb/reference/sql-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: SQL Reference
sidebar_label: SQL Reference
slug: /en/chdb/reference/sql-reference
description: SQL Reference for chDB
keywords: [chdb, sql reference]
---

chdb supports the same SQL syntax, statements, engines and functions as ClickHouse:

| Topic |
|-------------------------------------------------------------------|
| [SQL Syntax](/docs/en/sql-reference/syntax) |
| [Statements](/docs/en/sql-reference/statements) |
| [Table Engines](/docs/en/engines/table-engines) |
| [Database Engines](/docs/en/engines/database-engines) |
| [Regular Functions](/docs/en/sql-reference/functions) |
| [Aggregate Functions](/docs/en/sql-reference/aggregate-functions) |
| [Table Functions](/docs/en/sql-reference/table-functions) |
| [Window Functions](/docs/en/sql-reference/window-functions) |

For further information and examples, see the [ClickHouse SQL Reference](/docs/en/sql-reference).
20 changes: 0 additions & 20 deletions docs/en/chdb/sql-reference.md

This file was deleted.

7 changes: 5 additions & 2 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,7 @@ const sidebars = {
className: "top-nav-item",
collapsed: false,
collapsible: false,
link: {type: "doc", id: "en/chdb/install/index"},
items: [
"en/chdb/install/python",
"en/chdb/install/nodejs",
Expand All @@ -1385,6 +1386,7 @@ const sidebars = {
className: "top-nav-item",
collapsed: false,
collapsible: false,
link: {type: "doc", id: "en/chdb/guides/index"},
items: [
"en/chdb/guides/jupysql",
"en/chdb/guides/querying-pandas",
Expand All @@ -1401,9 +1403,10 @@ const sidebars = {
className: "top-nav-item",
collapsed: false,
collapsible: false,
link: {type: "doc", id: "en/chdb/reference/index"},
items: [
"en/chdb/data-formats",
"en/chdb/sql-reference"
"en/chdb/reference/data-formats",
"en/chdb/reference/sql-reference"
],
},
{
Expand Down

0 comments on commit ac5d7c2

Please sign in to comment.