1use super::*;
2
3#[derive(Clone, Debug, Default, Deserialize, Eq, Getter, New, PartialEq, Serialize)]
5pub struct DocFooterItem {
6 #[serde(default)]
8 pub(crate) text: String,
9 #[serde(default)]
11 pub(crate) link: String,
12 #[serde(default)]
14 pub(crate) icon: String,
15 #[serde(default)]
17 pub(crate) alt: String,
18}
19
20#[derive(Clone, Debug, Default, Deserialize, Eq, Getter, New, PartialEq, Serialize)]
22pub struct DocNavbarItem {
23 #[serde(default)]
25 pub(crate) text: String,
26 #[serde(default)]
28 pub(crate) link: String,
29}
30
31#[derive(Clone, Debug, Default, Deserialize, Eq, Getter, PartialEq, Serialize)]
33pub struct DocLocaleConfig {
34 #[serde(default)]
36 pub(crate) prefix: String,
37 #[serde(default)]
39 pub(crate) dir: String,
40 #[serde(default)]
42 pub(crate) lang: String,
43 #[serde(default)]
45 pub(crate) label: String,
46 #[serde(default)]
48 pub(crate) title: Option<String>,
49 #[serde(default)]
51 pub(crate) description: Option<String>,
52 #[serde(default)]
54 pub(crate) footer: Option<String>,
55 #[serde(default)]
57 pub(crate) toc_label: Option<String>,
58 #[serde(default)]
60 pub(crate) prev_label: Option<String>,
61 #[serde(default)]
63 pub(crate) next_label: Option<String>,
64 #[serde(default)]
66 pub(crate) navbar: Vec<DocNavbarItem>,
67}
68
69#[derive(Clone, Debug, Default, Deserialize, Eq, Getter, New, PartialEq, Serialize)]
71pub struct DocHomeAction {
72 #[serde(default)]
74 pub(crate) text: String,
75 #[serde(default)]
77 pub(crate) link: String,
78 #[serde(default)]
80 pub(crate) icon: String,
81 #[serde(rename = "type", default)]
83 pub(crate) kind: String,
84}
85
86#[derive(Clone, Debug, Default, Deserialize, Eq, Getter, New, PartialEq, Serialize)]
88pub struct DocHomeStat {
89 #[serde(default)]
91 pub(crate) icon: String,
92 #[serde(default)]
94 pub(crate) value: String,
95 #[serde(default)]
97 pub(crate) label: String,
98}
99
100#[derive(Clone, Debug, Default, Deserialize, Eq, Getter, New, PartialEq, Serialize)]
102pub struct DocHomeFeature {
103 #[serde(default)]
105 pub(crate) title: String,
106 #[serde(default)]
108 pub(crate) details: String,
109 #[serde(default)]
111 pub(crate) link: String,
112}
113
114#[derive(Clone, Debug, Default, Deserialize, Getter, PartialEq, Serialize)]
116pub struct DocSiteFrontmatter {
117 pub(crate) title: Option<String>,
119 pub(crate) description: Option<String>,
121 pub(crate) logo: Option<String>,
123 pub(crate) footer: Option<String>,
125 #[serde(default)]
127 pub(crate) footer_link: Option<String>,
128 #[serde(default)]
130 pub(crate) footer_items: Vec<DocFooterItem>,
131}
132
133#[derive(Clone, Debug, Default, Deserialize, Getter, PartialEq, Serialize)]
135pub struct DocSiteConfig {
136 #[serde(default)]
138 pub(crate) site: DocSiteFrontmatter,
139 #[serde(default)]
141 pub(crate) locales: Vec<DocLocaleConfig>,
142}
143
144#[derive(Clone, Debug, Default, Deserialize, Getter, PartialEq, Serialize)]
146pub struct DocDirFrontmatter {
147 #[serde(default)]
149 #[get(type(copy))]
150 pub(crate) order: Option<i32>,
151 #[serde(default)]
153 pub(crate) text: Option<String>,
154 #[serde(default)]
156 #[get(type(copy))]
157 pub(crate) link: Option<bool>,
158 #[serde(default)]
160 #[get(type(copy))]
161 pub(crate) collapsible: Option<bool>,
162}
163
164#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
166pub struct DocFrontmatter {
167 pub(crate) title: Option<String>,
169 pub(crate) order: Option<i32>,
171 pub(crate) tagline: Option<String>,
173 #[serde(default)]
175 pub(crate) description: Option<String>,
176 pub(crate) section: Option<String>,
178 #[serde(default)]
180 pub(crate) updated: Option<String>,
181 #[serde(default)]
183 pub(crate) date: Option<String>,
184 #[serde(default)]
186 pub(crate) category: Vec<String>,
187 #[serde(default)]
189 pub(crate) index: Option<bool>,
190 #[serde(default)]
192 pub(crate) expanded: Option<bool>,
193 #[serde(default)]
195 pub(crate) dir: Option<DocDirFrontmatter>,
196 #[serde(default)]
198 pub(crate) password: Option<String>,
199 #[serde(default)]
201 pub(crate) head: Value,
202 #[serde(default)]
204 pub(crate) home: bool,
205 #[serde(rename = "heroText", default)]
207 pub(crate) hero_text: Option<String>,
208 #[serde(default)]
210 pub(crate) actions: Vec<DocHomeAction>,
211 #[serde(default)]
213 pub(crate) stats: Vec<DocHomeStat>,
214 #[serde(default)]
216 pub(crate) features: Vec<DocHomeFeature>,
217 #[serde(default)]
219 pub(crate) sidebar_order: Vec<String>,
220 #[serde(default)]
222 pub(crate) sidebar: Option<bool>,
223 pub(crate) site: Option<DocSiteFrontmatter>,
225 #[serde(default)]
227 pub(crate) locales: Vec<DocLocaleConfig>,
228}
229
230#[derive(Clone, Data, Debug, Default, Deserialize, PartialEq, Serialize)]
232pub struct DocCatalogNode {
233 pub(crate) key: String,
235 pub(crate) title: String,
237 pub(crate) route: Option<String>,
239 pub(crate) first_child_route: Option<String>,
241 #[get(type(copy))]
243 pub(crate) is_dir: bool,
244 #[get(type(copy))]
246 pub(crate) index_disabled: bool,
247 #[get(type(copy))]
249 pub(crate) has_own_content: bool,
250 #[get(type(copy))]
252 pub(crate) expanded_pref: Option<bool>,
253 #[get(type(copy))]
255 pub(crate) collapsible: bool,
256 #[get(type(copy))]
258 pub(crate) order: i32,
259 #[get(type(copy))]
261 pub(crate) locked: bool,
262 #[serde(default, skip_serializing_if = "Vec::is_empty")]
264 pub(crate) children: Vec<DocCatalogNode>,
265}
266
267#[derive(Clone, Data, Debug, Deserialize, PartialEq, Serialize)]
269pub struct DocTocTreeNode {
270 pub(crate) item: DocTocItem,
272 #[serde(default, skip_serializing_if = "Vec::is_empty")]
274 pub(crate) children: Vec<DocTocTreeNode>,
275}
276
277#[derive(Clone, Debug, Default, Deserialize, Eq, Getter, New, PartialEq, Serialize)]
279pub struct DocsCatalogArtifact {
280 pub(crate) name: String,
282 #[get(type(copy))]
284 pub(crate) file_count: u64,
285 #[get(type(copy))]
287 pub(crate) total_bytes: u64,
288 pub(crate) sha256: String,
290 #[get(type(copy))]
292 pub(crate) updated_at: i64,
293}
294
295#[derive(Clone, Debug, Deserialize, Eq, Getter, New, PartialEq, Serialize)]
297pub struct SearchIndexEntry {
298 pub(crate) route: String,
300 pub(crate) title: String,
302 pub(crate) section: String,
304 pub(crate) summary: String,
306 pub(crate) headings: Vec<String>,
308 pub(crate) excerpt: String,
310}
311
312#[derive(Clone, Debug, Deserialize, Getter, New, PartialEq, Serialize)]
314pub struct DocTocItem {
315 #[get(type(copy))]
317 pub(crate) level: u8,
318 pub(crate) slug: String,
320 pub(crate) title: String,
322}
323
324#[derive(Clone, Debug, Deserialize, Getter, New, PartialEq, Serialize)]
326pub struct DocPage {
327 pub(crate) route: String,
329 pub(crate) title: String,
331 #[get(type(copy))]
333 pub(crate) order: i32,
334 pub(crate) section: String,
336 pub(crate) summary: String,
338 #[serde(default, skip_serializing_if = "Vec::is_empty")]
340 pub(crate) blocks: Vec<DocBlock>,
341 pub(crate) toc: Vec<DocTocItem>,
343 #[serde(default, skip_serializing_if = "String::is_empty")]
345 #[get(pub(crate))]
346 #[new(skip)]
347 pub(crate) markdown_body: String,
348 #[serde(default, skip_serializing_if = "Option::is_none")]
350 #[new(skip)]
351 pub(crate) updated: Option<String>,
352 #[serde(default)]
354 #[get(type(copy))]
355 #[new(skip)]
356 pub(crate) is_home: bool,
357 #[serde(default, skip_serializing_if = "Option::is_none")]
359 #[new(skip)]
360 pub(crate) hero_text: Option<String>,
361 #[serde(default, skip_serializing_if = "Vec::is_empty")]
363 #[new(skip)]
364 pub(crate) actions: Vec<DocHomeAction>,
365 #[serde(default, skip_serializing_if = "Vec::is_empty")]
367 #[new(skip)]
368 pub(crate) stats: Vec<DocHomeStat>,
369 #[serde(default, skip_serializing_if = "Vec::is_empty")]
371 #[new(skip)]
372 pub(crate) features: Vec<DocHomeFeature>,
373 #[serde(default)]
375 #[get(type(copy))]
376 #[new(skip)]
377 pub(crate) hide_sidebar: bool,
378 #[serde(default, skip_serializing_if = "String::is_empty")]
380 #[new(skip)]
381 pub(crate) source_rel_path: String,
382 #[serde(default)]
384 #[get(type(copy))]
385 #[new(skip)]
386 pub(crate) is_dir_index: bool,
387 #[serde(default)]
389 #[get(type(copy))]
390 #[new(skip)]
391 pub(crate) index_disabled: bool,
392 #[serde(default, skip_serializing_if = "Option::is_none")]
394 #[get(type(copy))]
395 #[new(skip)]
396 pub(crate) dir_expanded: Option<bool>,
397 #[serde(default, skip_serializing_if = "Option::is_none")]
399 #[get(type(copy))]
400 #[new(skip)]
401 pub(crate) dir_order: Option<i32>,
402 #[serde(default, skip_serializing_if = "Option::is_none")]
404 #[new(skip)]
405 pub(crate) dir_text: Option<String>,
406 #[serde(default, skip_serializing_if = "Option::is_none")]
408 #[get(type(copy))]
409 #[new(skip)]
410 pub(crate) dir_collapsible: Option<bool>,
411 #[serde(default, skip_serializing_if = "Option::is_none")]
413 #[new(skip)]
414 pub(crate) password: Option<String>,
415 #[serde(default, skip_serializing_if = "Option::is_none")]
417 #[new(skip)]
418 pub(crate) date: Option<String>,
419 #[serde(default, skip_serializing_if = "Vec::is_empty")]
421 #[new(skip)]
422 pub(crate) categories: Vec<String>,
423}
424
425#[derive(Clone, Data, Debug, Deserialize, New, PartialEq, Serialize)]
427pub struct DocSite {
428 pub(crate) title: String,
430 pub(crate) tagline: String,
432 pub(crate) pages: Vec<DocPage>,
434 #[serde(default, skip_serializing_if = "String::is_empty")]
436 #[new(skip)]
437 pub(crate) lang: String,
438 #[serde(default, skip_serializing_if = "String::is_empty")]
440 #[new(skip)]
441 pub(crate) locale_prefix: String,
442 #[serde(default, skip_serializing_if = "String::is_empty")]
444 #[new(skip)]
445 pub(crate) logo: String,
446 #[serde(default, skip_serializing_if = "String::is_empty")]
448 #[new(skip)]
449 pub(crate) footer: String,
450 #[serde(default, skip_serializing_if = "String::is_empty")]
452 #[new(skip)]
453 pub(crate) footer_link: String,
454 #[serde(default, skip_serializing_if = "Vec::is_empty")]
456 #[new(skip)]
457 pub(crate) footer_items: Vec<DocFooterItem>,
458 #[serde(default, skip_serializing_if = "String::is_empty")]
460 #[new(skip)]
461 pub(crate) toc_label: String,
462 #[serde(default, skip_serializing_if = "String::is_empty")]
464 #[new(skip)]
465 pub(crate) prev_label: String,
466 #[serde(default, skip_serializing_if = "String::is_empty")]
468 #[new(skip)]
469 pub(crate) next_label: String,
470 #[serde(default, skip_serializing_if = "Vec::is_empty")]
472 #[new(skip)]
473 pub(crate) navbar: Vec<DocNavbarItem>,
474 #[serde(default, skip_serializing_if = "Vec::is_empty")]
476 #[new(skip)]
477 pub(crate) locales: Vec<DocLocaleConfig>,
478 #[serde(default, skip_serializing_if = "String::is_empty")]
480 #[new(skip)]
481 pub(crate) release_marker: String,
482}