Skip to content

Commit 42b089e

Browse files
authored
docs: establish doc templating, building, and strategy (#31)
* initial updates with jupyter tutorials and styling * filling out some docs * add blank index * update docs workflow * clean up style sheet
1 parent 864d029 commit 42b089e

File tree

19 files changed

+2848
-109
lines changed

19 files changed

+2848
-109
lines changed
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name: build_docs
2-
# Disable for now while the repo is private
3-
# on:
4-
# push:
5-
# branches:
6-
# - main
2+
on:
3+
push:
4+
branches:
5+
- main
76
jobs:
87
deploy:
98
runs-on: ubuntu-latest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,5 @@ src/data_designer/_version.py
8686
.scratch/
8787

8888
.claude/
89+
90+
docs/examples/artifacts/

docs/assets/palette-favicon.png

13.3 KB
Loading
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Column Configurations
2+
3+
The `column_configs` module defines configuration objects for all Data Designer column types. Each configuration inherits from [SingleColumnConfig](#data_designer.config.column_configs.SingleColumnConfig), which provides shared arguments like the column `name`, whether to `drop` the column after generation, and the `column_type`.
4+
5+
!!! info "`column_type` is a discriminator field"
6+
The `column_type` argument is used to identify column types when deserializing the [Data Designer Config](data_designer_config.md) from JSON/YAML. It acts as the discriminator in a [discriminated union](https://docs.pydantic.dev/latest/concepts/unions/#discriminated-unions), allowing Pydantic to automatically determine which column configuration class to instantiate.
7+
8+
::: data_designer.config.column_configs
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Data Designer's Config Builder
2+
3+
The `config_builder` module provides a high-level interface for constructing Data Designer configurations through the [DataDesignerConfigBuilder](#data_designer.config.config_builder.DataDesignerConfigBuilder) class, enabling programmatic creation of [DataDesignerConfig](data_designer_config.md#data_designer.config.data_designer_config.DataDesignerConfig) objects by incrementally adding column configurations, constraints, processors, and profilers.
4+
5+
You can use the builder to create Data Designer configurations from scratch or from existing configurations stored in YAML/JSON files via [`from_config()`](#data_designer.config.config_builder.DataDesignerConfigBuilder.from_config). The builder includes validation capabilities to catch configuration errors early and can work with seed datasets from local sources or external datastores. Once configured, use [`build()`](#data_designer.config.config_builder.DataDesignerConfigBuilder.build) to generate the final configuration object or [`write_config()`](#data_designer.config.config_builder.DataDesignerConfigBuilder.write_config) to serialize it to disk.
6+
7+
!!! info "Model configs are required"
8+
[DataDesignerConfigBuilder](#data_designer.config.config_builder.DataDesignerConfigBuilder) requires a list of model configurations at initialization. This tells the builder which model aliases can be referenced by LLM-generated columns (such as [`LLMTextColumnConfig`](column_configs.md#data_designer.config.column_configs.LLMTextColumnConfig), [`LLMCodeColumnConfig`](column_configs.md#data_designer.config.column_configs.LLMCodeColumnConfig), [`LLMStructuredColumnConfig`](column_configs.md#data_designer.config.column_configs.LLMStructuredColumnConfig), and [`LLMJudgeColumnConfig`](column_configs.md#data_designer.config.column_configs.LLMJudgeColumnConfig)). Each model configuration specifies the model alias, model provider, model ID, and inference parameters that will be used during data generation.
9+
10+
::: data_designer.config.config_builder
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Data Designer Configuration
2+
3+
[DataDesignerConfig](#data_designer.config.data_designer_config.DataDesignerConfig) is the main configuration object for builder datasets with Data Designer. It is a declarative configuration for defining the dataset you want to generate column-by-column, including options for dataset post-processing, validation, and profiling.
4+
5+
Generally, you should use the [DataDesignerConfigBuilder](config_builder.md#data_designer.config.config_builder.DataDesignerConfigBuilder) to build your configuration, but you can also build it manually by instantiating the [DataDesignerConfig](#data_designer.config.data_designer_config.DataDesignerConfig) class directly.
6+
7+
::: data_designer.config.data_designer_config

docs/css/code_select.css

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/css/mkdocstrings.css

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/* Indentation. */
2+
div.doc-contents:not(.first) {
3+
padding-left: 25px;
4+
border-left: .05rem solid var(--md-typeset-table-color);
5+
}
6+
7+
/* Mark external links as such. */
8+
a.external::after,
9+
a.autorefs-external::after {
10+
/* https://primer.style/octicons/arrow-up-right-24 */
11+
mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
12+
-webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
13+
content: ' ';
14+
15+
display: inline-block;
16+
vertical-align: middle;
17+
position: relative;
18+
19+
height: 1em;
20+
width: 1em;
21+
background-color: currentColor;
22+
}
23+
24+
a.external:hover::after,
25+
a.autorefs-external:hover::after {
26+
background-color: var(--md-accent-fg-color);
27+
}
28+
29+
/* Tree-like output for backlinks. */
30+
.doc-backlink-list {
31+
--tree-clr: var(--md-default-fg-color);
32+
--tree-font-size: 1rem;
33+
--tree-item-height: 1;
34+
--tree-offset: 1rem;
35+
--tree-thickness: 1px;
36+
--tree-style: solid;
37+
display: grid;
38+
list-style: none !important;
39+
}
40+
41+
.doc-backlink-list li > span:first-child {
42+
text-indent: .3rem;
43+
}
44+
.doc-backlink-list li {
45+
padding-inline-start: var(--tree-offset);
46+
border-left: var(--tree-thickness) var(--tree-style) var(--tree-clr);
47+
position: relative;
48+
margin-left: 0 !important;
49+
50+
&:last-child {
51+
border-color: transparent;
52+
}
53+
&::before{
54+
content: '';
55+
position: absolute;
56+
top: calc(var(--tree-item-height) / 2 * -1 * var(--tree-font-size) + var(--tree-thickness));
57+
left: calc(var(--tree-thickness) * -1);
58+
width: calc(var(--tree-offset) + var(--tree-thickness) * 2);
59+
height: calc(var(--tree-item-height) * var(--tree-font-size));
60+
border-left: var(--tree-thickness) var(--tree-style) var(--tree-clr);
61+
border-bottom: var(--tree-thickness) var(--tree-style) var(--tree-clr);
62+
}
63+
&::after{
64+
content: '';
65+
position: absolute;
66+
border-radius: 50%;
67+
background-color: var(--tree-clr);
68+
top: calc(var(--tree-item-height) / 2 * 1rem);
69+
left: var(--tree-offset) ;
70+
translate: calc(var(--tree-thickness) * -1) calc(var(--tree-thickness) * -1);
71+
}
72+
}

docs/css/style.css

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
2+
.nvidia-green {
3+
color: #76B900; /* NVIDIA green */
4+
}
5+
6+
/* Style "NeMo" in the site name with pure CSS */
7+
.md-header__topic:first-child .md-ellipsis {
8+
visibility: hidden;
9+
position: relative;
10+
}
11+
12+
/* Make "NeMo" green using a gradient background trick */
13+
.md-header__topic:first-child .md-ellipsis::after {
14+
content: "NeMo Data Designer";
15+
visibility: visible;
16+
position: absolute;
17+
left: 0;
18+
top: 0;
19+
background: linear-gradient(90deg, #76B900 0%, #76B900 4.8ch, currentColor 4.8ch, currentColor 100%);
20+
-webkit-background-clip: text;
21+
-webkit-text-fill-color: transparent;
22+
background-clip: text;
23+
}
24+
25+
/* Prevent selection of prompt and output markers */
26+
.highlight .gp,
27+
.highlight .go {
28+
user-select: none;
29+
}
30+
31+
/* Reduce space between logo and site name */
32+
.md-header__button.md-logo {
33+
margin-right: -1rem;
34+
}
35+
36+
/* Remove background from Jupyter notebook outputs */
37+
.jp-RenderedText pre,
38+
.jp-OutputArea-output pre,
39+
.output_stderr,
40+
.output_stdout,
41+
.output_stream,
42+
div.output_area pre,
43+
div.output_subarea pre,
44+
.jupyter-wrapper .output_stream,
45+
.jupyter-wrapper .output_stdout,
46+
.jupyter-wrapper .output_stderr,
47+
.jp-RenderedText[data-mime-type="application/vnd.jupyter.stderr"],
48+
.jp-RenderedText[data-mime-type="application/vnd.jupyter.stderr"] pre,
49+
.jp-OutputArea-output[data-mime-type="application/vnd.jupyter.stderr"],
50+
.jp-OutputArea-output[data-mime-type="application/vnd.jupyter.stderr"] pre {
51+
background-color: transparent !important;
52+
}
53+
54+
/* Override stderr-specific styling */
55+
.highlight .err {
56+
background-color: transparent !important;
57+
border: none !important;
58+
}
59+
60+
/* Make notebook cells grow with window size */
61+
.md-content__inner {
62+
max-width: none !important;
63+
}
64+
65+
.md-content__inner:has(.jp-Notebook) {
66+
padding-left: 0rem !important;
67+
padding-right: 0.5rem !important;
68+
}
69+
70+
/* Rich output with horizontal scroll and compact tables */
71+
.jp-RenderedText pre,
72+
.jp-OutputArea-output pre,
73+
.jp-RenderedHTMLCommon pre,
74+
.jp-RenderedHTML pre {
75+
white-space: pre !important;
76+
overflow-x: auto !important;
77+
font-size: 0.6rem !important;
78+
line-height: 1.1 !important;
79+
padding: 0.25rem !important;
80+
margin: 0.25rem 0 !important;
81+
}
82+
83+
/* Narrow sidebar */
84+
.md-sidebar--primary,
85+
.md-sidebar--primary .md-sidebar__scrollwrap {
86+
width: 10rem !important;
87+
}
88+
89+
/* Hide right sidebar (TOC) by default, JavaScript will show it on Code Reference pages */
90+
.md-sidebar.md-sidebar--secondary {
91+
display: none !important;
92+
}
93+
94+
/* Show TOC on Code Reference pages (controlled by JavaScript) */
95+
body.show-toc .md-sidebar.md-sidebar--secondary {
96+
display: block !important;
97+
}
98+
99+
/* Hide footer */
100+
.md-footer {
101+
display: none !important;
102+
}
103+
104+
/* Move repo and palette icons to the right */
105+
.md-header__inner {
106+
padding-right: 0rem !important;
107+
}
108+
109+
/* Reduce space between h1 headings and content below */
110+
h1 {
111+
margin-bottom: 0.5rem !important;
112+
}
113+
h2 {
114+
margin-top: 0.2rem !important;
115+
margin-bottom: 0.2rem !important;
116+
}
117+
118+
/* Define the company grid layout */
119+
120+
#grid-container {
121+
width: 100%;
122+
text-align: center;
123+
}
124+
125+
#company-grid {
126+
display: inline-block;
127+
margin: 0 auto;
128+
gap: 10px;
129+
align-content: center;
130+
justify-content: center;
131+
grid-auto-flow: column;
132+
}
133+
134+
[data-md-color-scheme="slate"] #company-grid {
135+
background-color: #ffffff;
136+
border-radius: .5rem;
137+
color: black;
138+
}
139+
140+
.tile {
141+
display: inline-block;
142+
text-align: center;
143+
width: 120px;
144+
height: 120px;
145+
margin: 10px;
146+
padding: 5px;
147+
border-radius: .5rem;
148+
}
149+
150+
.tile img {
151+
width: 100px;
152+
}
153+
154+
.md-typeset__table > table {
155+
max-height: 60vh;
156+
}
157+
158+
.md-typeset__table > table thead {
159+
position: sticky;
160+
top: 0;
161+
background-color: var(--md-default-bg-color);
162+
}
163+
164+
.md-typeset__table > table th {
165+
border-bottom: .05rem solid var(--md-typeset-table-color);
166+
}
167+
168+
.md-typeset__table > table tr:first-child td {
169+
border-top: none;
170+
}

docs/index.md

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

0 commit comments

Comments
 (0)