Skip to content

Commit bdf691e

Browse files
committed
first test
1 parent 928de69 commit bdf691e

File tree

23 files changed

+387
-0
lines changed

23 files changed

+387
-0
lines changed

.github/workflows/build_docs.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: build_docs
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: astral-sh/setup-uv@v6
14+
with:
15+
version: "0.9.5"
16+
- run: uv python install
17+
- run: uv sync
18+
- run: uv run mkdocs gh-deploy --force --clean --verbose

docs/css/code_select.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.highlight .gp, .highlight .go { /* Generic.Prompt, Generic.Output */
2+
user-select: none;
3+
}

docs/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Data Designer
2+
3+
Welcome to the Data Designer documentation.

mkdocs.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
site_name: Data Designer
2+
theme:
3+
name: material
4+
plugins:
5+
- search
6+
- gen-files:
7+
scripts:
8+
- scripts/gen_ref_pages.py
9+
- literate-nav:
10+
nav_file: SUMMARY.md
11+
- section-index
12+
- mkdocstrings:
13+
handlers:
14+
python:
15+
paths: [src]
16+
filters: "!^(__.*__$)"
17+
nav:
18+
- Welcome: index.md
19+
- Code Reference: reference/
20+
extra_css:
21+
- css/code_select.css

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ dependencies = [
5050
"sqlfluff==3.2.0",
5151
"tiktoken>=0.8.0",
5252
"ruff==0.12.3",
53+
"mkdocs>=1.6.1",
54+
"mkdocstrings>=0.30.1",
55+
"mkdocstrings-python>=1.18.2",
56+
"mkdocs-gen-files>=0.5.0",
57+
"mkdocs-literate-nav>=0.6.2",
58+
"mkdocs-section-index>=0.3.10",
59+
"mkdocs-material>=9.6.22",
5360
]
5461

5562
[dependency-groups]

scripts/gen_ref_pages.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
"""Generate the code reference pages and navigation."""
2+
3+
from pathlib import Path
4+
5+
import griffe
6+
import mkdocs_gen_files
7+
8+
data = griffe.load("data_designer")
9+
nav = mkdocs_gen_files.Nav()
10+
11+
root = Path(__file__).parent.parent
12+
src = root / "src"
13+
14+
for path in sorted(src.rglob("*.py")):
15+
module_path = path.relative_to(src).with_suffix("")
16+
doc_path = path.relative_to(src).with_suffix(".md")
17+
full_doc_path = Path("reference", doc_path)
18+
19+
parts = tuple(module_path.parts)
20+
21+
if parts[-1] == "__main__":
22+
continue
23+
24+
if parts[-1] == "__init__":
25+
parts = parts[:-1]
26+
doc_path = doc_path.with_name("index.md")
27+
full_doc_path = full_doc_path.with_name("index.md")
28+
29+
init_module = data[parts[1:]] if len(parts) > 1 else data
30+
has_docstrings = init_module.has_docstring or any(
31+
member.has_docstrings for member in init_module.members.values()
32+
if not (member.is_alias or member.is_module)
33+
)
34+
else:
35+
has_docstrings = data[parts[1:]].has_docstrings
36+
37+
if not has_docstrings:
38+
continue
39+
40+
nav[parts] = doc_path.as_posix()
41+
with mkdocs_gen_files.open(full_doc_path, "w") as fd:
42+
ident = ".".join(parts)
43+
fd.write(f"::: {ident}")
44+
45+
mkdocs_gen_files.set_edit_path(full_doc_path, path.relative_to(root))
46+
47+
with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file:
48+
nav_file.writelines(nav.build_literate_nav())

src/data_designer/config/analysis/__init__.py

Whitespace-only changes.

src/data_designer/config/analysis/utils/__init__.py

Whitespace-only changes.

src/data_designer/config/utils/__init__.py

Whitespace-only changes.

src/data_designer/engine/analysis/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)