Repository navigation
Expand file tree
/
Copy pathsidebars.js
More file actions
361 lines (352 loc) · 16.3 KB
/
Copy pathsidebars.js
File metadata and controls
361 lines (352 loc) · 16.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
// @ts-check
/**
* The docs have four sidebars, all served by the one docs plugin so that
* every /docs/... URL stays the same:
*
* - cdi: Snowplow CDI, grouped by what the reader is doing
* - signals: Snowplow Signals
* - reference: lookup material, plus every previous-versions tree under Legacy
* - platform: deploying, running, and administering Snowplow, and AI tooling
* (Platform & AI in the navbar)
*
* Each top-level group is a section header; a pick at the top level is an
* unheaded page. `pick(path)` pulls a directory
* (or a single page) out of docs/ with its autogenerated children; see
* utils/sidebar-items-generator.js for the options. A doc belongs to the
* sidebar that lists it, and the navbar tabs follow that sidebar.
*
* Run `node utils/check-sidebars.js` after a build to check that every page
* is in exactly one sidebar.
*/
const path = require('path')
/**
* Pick a directory or page from docs/, with its autogenerated children.
* @param {string} docsPath path relative to docs/, without extension
* @param {{label?: string, hoist?: boolean, indexOnly?: boolean, indexLabel?: string, className?: string, collapsed?: boolean, customProps?: object, exclude?: string[]}} [opts]
* `hoist` lists the directory's children directly, with its index page first
* (labeled `indexLabel`). `indexOnly` takes just the directory's index page,
* for when its children are picked one by one. `exclude` drops docs paths
* from the picked tree, for pages listed in another group.
*/
const pick = (docsPath, opts = {}) => ({
type: 'autogenerated',
dirName: path.posix.dirname(docsPath),
customProps: { pick: { path: docsPath, ...opts } },
})
/** A top-level group label in the sidebar */
const group = (label, items, { collapsible = false, collapsed = false } = {}) => ({
type: 'category',
label,
className: 'section-header',
collapsible,
collapsed,
items,
})
/**
* A category that groups picks which share no directory. Collapsed unless
* `collapsed: false`; the active-page auto-expand opens it either way.
*/
const sub = (label, items, { collapsed = true } = {}) => ({
type: 'category',
label,
collapsible: true,
collapsed,
items,
})
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
cdi: [
// Only the path to a first result. Deployment, infrastructure, and
// account pages live in the platform sidebar. Every other group starts
// collapsed; the group holding the current page opens automatically.
group('Get started', [
// The docs home hides its sidebar; listed here so it belongs to one
pick('introduction', { label: 'Docs home', className: 'hidden' }),
pick('cdi', { label: 'CDI overview' }),
// Redirects to the CDI overview (worker/redirects.js), so it stays hidden
pick('get-started', { indexOnly: true, label: 'First steps', className: 'hidden' }),
pick('get-started/quickstart', { label: 'Quickstart with your coding agent' }),
sub(
'Quickstart step by step',
[
pick('get-started/free-trial', { label: 'Start a free trial' }),
pick('get-started/console', { label: 'Explore Console' }),
pick('get-started/tracking', { indexOnly: true, label: 'Track your first events' }),
pick('get-started/custom-events', { label: 'Define custom events' }),
pick('get-started/querying', { label: 'Query your first events' }),
]
// Collapsed elsewhere; opens automatically on its own pages
),
]),
// In the order people do the work. Snowtype code generation lives with
// the trackers, under Collect events; the hand-off page links to it.
group('Design tracking', [
pick('event-studio', { indexOnly: true, label: 'Event Studio overview' }),
pick('event-studio/source-applications', { label: 'Plan source applications' }),
pick('event-studio/data-structures', {
label: 'Manage data structures',
exclude: ['event-studio/data-structures/json-editor'],
}),
sub('Manage tracking plans', [
pick('event-studio/tracking-plans', {
hoist: true,
indexLabel: 'Tracking plan elements',
exclude: [
'event-studio/tracking-plans/data-quality',
'event-studio/tracking-plans/event-specification-inference',
'event-studio/tracking-plans/event-specification-validation',
],
}),
pick('event-studio/event-catalog', { label: 'Find existing events' }),
sub('Monitor tracking plans', [
pick('event-studio/tracking-plans/data-quality', { label: 'Check volumes and violations' }),
pick('event-studio/tracking-plans/event-specification-inference', { label: 'How inference matches events' }),
pick('event-studio/tracking-plans/event-specification-validation', { label: 'How validation checks events' }),
]),
]),
pick('event-studio/hand-off-to-implementation', { label: 'Hand off to developers' }),
pick('event-studio/test-and-publish', { label: 'Test, promote, and publish' }),
pick('event-studio/evolve-tracking-design', { label: 'Evolve your tracking design' }),
// The overview, not the API pages, covers the CLI and CI/CD, so it gets its own entry
sub('Manage tracking as code', [
pick('event-studio/programmatic-management', { hoist: true, indexLabel: 'Automate with the CLI and CI/CD' }),
]),
// Redirects to Create a data structure (worker/redirects.js), so it stays hidden
pick('event-studio/data-structures/json-editor', { className: 'hidden' }),
], { collapsible: true, collapsed: true }),
group('Collect events', [
pick('sources', { indexOnly: true, label: 'Trackers overview' }),
pick('event-studio/implement-tracking', { label: 'Generate tracking code with Snowtype' }),
sub('Web', [
pick('sources/web-trackers'),
pick('sources/google-tag-manager'),
pick('sources/cdn-trackers'),
pick('sources/google-amp-tracker'),
pick('sources/pixel-tracker'),
pick('sources/webview-tracker'),
pick('get-started/tracking/cookies-and-ad-blockers'),
]),
sub('Mobile, TV, and games', [
pick('sources/mobile-trackers'),
pick('sources/react-native-tracker'),
pick('sources/flutter-tracker'),
pick('sources/roku-tracker'),
pick('sources/unity-tracker'),
]),
sub('Server and desktop', [
pick('sources/node-js-tracker'),
pick('sources/python-tracker'),
pick('sources/java-tracker'),
pick('sources/golang-tracker'),
pick('sources/net-tracker'),
pick('sources/ruby-tracker'),
pick('sources/php-tracker'),
pick('sources/scala-tracker'),
pick('sources/rust-tracker'),
pick('sources/c-tracker'),
pick('sources/lua-tracker'),
]),
pick('sources/webhooks'),
pick('events', { label: 'Built-in events and entities' }),
], { collapsible: true, collapsed: true }),
group('Test your tracking', [
pick('testing', { hoist: true, indexLabel: 'Testing overview' }),
], { collapsible: true, collapsed: true }),
group('Enrich events', [
pick('pipeline/enrichments', { hoist: true, indexLabel: 'Enrichments overview' }),
], { collapsible: true, collapsed: true }),
// Identities runs in the pipeline, after enrichment, so it sits here and
// not under Query and model data
group('Identities', [
pick('identities', { hoist: true, indexLabel: 'Identities overview' }),
], { collapsible: true, collapsed: true }),
group('Load and forward', [
pick('destinations', {
hoist: true,
indexLabel: 'Destinations overview',
exclude: ['destinations/warehouses-lakes/querying-data'],
}),
], { collapsible: true, collapsed: true }),
// The shape of the data in the warehouse, then the models built on it
group('Query and model data', [
pick('destinations/warehouses-lakes/querying-data', { label: 'Query your data' }),
pick('fundamentals/warehouse-tables', { label: 'Atomic events table' }),
pick('fundamentals/canonical-event', { label: 'Atomic event fields' }),
pick('api-reference/loaders-storage-targets/schemas-in-warehouse', {
label: 'How schemas become columns',
}),
pick('get-started/modeling', { label: 'Run your first data model' }),
pick('modeling-your-data', {
hoist: true,
indexLabel: 'Data models overview',
exclude: ['modeling-your-data/modeling-your-data-with-sql-runner'],
}),
{ type: 'link', label: 'Identities data models', href: '/docs/identities/data-models/' },
// A `type: link` stub that redirects to Query your data
pick('event-studio/query-sql', { className: 'hidden' }),
], { collapsible: true, collapsed: true }),
group('Monitor data quality', [
pick('failed-events', { label: 'Find and fix failed events' }),
pick('get-started/failed-events', { label: 'Inspect your first failed events' }),
pick('monitoring', { hoist: true, indexLabel: 'Monitor failed events in Console' }),
], { collapsible: true, collapsed: true }),
// Events, entities, and schemas: linked from every CDI page
group(
'Core concepts',
[
pick('fundamentals', {
hoist: true,
indexLabel: 'Concepts overview',
exclude: ['fundamentals/warehouse-tables', 'fundamentals/canonical-event'],
}),
],
{ collapsible: true, collapsed: true }
),
],
signals: [
group('Get started', [
pick('signals/introduction', { label: 'Signals overview' }),
pick('signals/quickstart', { label: 'Quickstart with your coding agent' }),
pick('signals/get-started/quickstart-tutorial', { label: 'Quickstart step by step' }),
// Redirects to the introduction (worker/redirects.js), so it stays hidden
pick('signals', { indexOnly: true, label: 'Signals', className: 'hidden' }),
]),
group('Set up and connect', [
pick('signals/concepts', { hoist: true, indexLabel: 'How Signals works' }),
pick('signals/setup'),
pick('signals/connection', { label: 'Connect with SDKs or API' }),
], { collapsible: true, collapsed: true }),
// Where attribute values come from: events (stream) or warehouse tables
group('Data sources', [
pick('signals/data-sources/events'),
pick('signals/data-sources/existing-analytics'),
pick('signals/attributes/warehouse-config', { label: 'Sync warehouse tables' }),
], { collapsible: true, collapsed: true }),
group('Define attributes', [
pick('signals/attributes', {
hoist: true,
indexLabel: 'Attributes overview',
exclude: ['signals/attributes/warehouse-config'],
}),
pick('signals/predictive-attributes', { label: 'Define predictive attributes' }),
pick('signals/publish'),
], { collapsible: true, collapsed: true }),
group('Serve attributes', [
pick('signals/applications', {
hoist: true,
indexLabel: 'Choose how to use attributes',
// The router page is linked from the overview, so its row stays hidden
indexClassName: 'hidden',
exclude: [
'signals/applications/agentic-contexts',
'signals/applications/mcp-server',
'signals/applications/subscribe',
'signals/applications/forward-interventions',
],
}),
], { collapsible: true, collapsed: true }),
group('Feed AI agents', [
pick('signals/agentic-contexts', { label: 'Define agentic contexts' }),
pick('signals/applications/agentic-contexts', { label: 'Retrieve agentic contexts' }),
pick('signals/applications/mcp-server'),
], { collapsible: true, collapsed: true }),
group('Intervene', [
pick('signals/interventions', { label: 'Define interventions' }),
pick('signals/applications/subscribe', { label: 'Receive interventions in your app' }),
pick('signals/applications/forward-interventions', { label: 'Forward interventions to your systems' }),
], { collapsible: true, collapsed: true }),
group('Train & evaluate models', [
pick('signals/datasets', { hoist: true, indexLabel: 'Datasets overview' }),
], { collapsible: true, collapsed: true }),
],
reference: [
pick('api-reference', { indexOnly: true, label: 'Reference overview' }),
group('APIs', [
pick('api-reference/console-api'),
pick('api-reference/snowplow-micro', { label: 'Snowplow Micro API' }),
pick('api-reference/snowplow-cli'),
]),
group('SDK reference', [
pick('api-reference/trackers'),
pick('api-reference/analytics-sdk'),
// The page itself is in the signals sidebar; this is a cross-link
{ type: 'link', label: 'Signals SDKs and API', href: '/docs/signals/connection/reference/' },
]),
group('Component configuration', [
pick('api-reference/stream-collector', { label: 'Collector configuration' }),
pick('api-reference/enrichment-components'),
pick('api-reference/loaders-storage-targets', {
exclude: ['api-reference/loaders-storage-targets/schemas-in-warehouse'],
}),
pick('api-reference/snowbridge'),
pick('api-reference/iglu'),
pick('api-reference/dataflow-runner'),
]),
group('Schemas, data, and versions', [
pick('api-reference/json-schema-reference'),
pick('api-reference/failed-events'),
pick('api-reference/versions'),
pick('sources/tracker-maintenance-classification'),
]),
group(
'Legacy',
[
pick('sources/web-trackers/previous-versions', { label: 'Web trackers' }),
pick('sources/mobile-trackers/previous-versions', { label: 'Native mobile trackers' }),
pick('sources/react-native-tracker/previous-version', { label: 'React Native tracker' }),
pick('sources/google-tag-manager/previous-versions', { label: 'Google Tag Manager' }),
pick('sources/node-js-tracker/previous-versions', { label: 'Node.js tracker' }),
pick('sources/java-tracker/previous-versions', { label: 'Java tracker' }),
pick('sources/python-tracker/previous_versions', { label: 'Python tracker' }),
pick('sources/scala-tracker/previous-versions', { label: 'Scala tracker' }),
pick('api-reference/loaders-storage-targets/bigquery-loader/previous-versions', {
label: 'BigQuery Loader',
}),
pick('api-reference/loaders-storage-targets/snowplow-rdb-loader/previous-versions', {
label: 'RDB Loader',
}),
pick(
'api-reference/loaders-storage-targets/snowplow-rdb-loader/rdb-loader-configuration-reference/rdb-loader-previous-versions',
{ label: 'RDB Loader configuration' }
),
pick('api-reference/snowplow-mini', { label: 'Snowplow Mini' }),
pick('sources/snowplow-tracking-cli', { label: 'Tracking CLI (unsupported)' }),
pick('modeling-your-data/modeling-your-data-with-sql-runner', { label: 'SQL Runner models' }),
],
{ collapsible: true, collapsed: true }
),
],
// For operators: deploying, running, and administering Snowplow. The
// navbar tab opens the first page, the platform overview.
platform: [
pick('platform', { label: 'Platform overview' }),
group('Deploy Snowplow', [
pick('get-started/deployment-options'),
pick('get-started/feature-comparison'),
pick('get-started/private-managed-cloud', { label: 'Private Managed Cloud setup' }),
pick('get-started/self-hosted', { label: 'Self-Hosted' }),
]),
group('Infrastructure and security', [
pick('pipeline', { indexOnly: true, label: 'Pipeline overview' }),
pick('pipeline/security', { label: 'Security overview' }),
pick('pipeline/collector', { label: 'Check Collector configuration' }),
pick('sources/first-party-tracking', { label: 'First-party Collector domain' }),
]),
group('Users and access', [
pick('account-management', { hoist: true, indexLabel: 'API keys and access tokens' }),
pick('licensing'),
]),
group('Migrate from another tool', [
pick('migration-guides', { hoist: true, indexLabel: 'Migration overview' }),
]),
group('Working with AI', [
pick('ai', { hoist: true, indexLabel: 'Snowplow + AI' }),
]),
group('Resources', [
pick('glossary'),
pick('discourse'),
pick('release-notes'),
]),
],
}
module.exports = sidebars