jacquard_api/sh_weaver/
notebook.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: sh.weaver.notebook.defs
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8pub mod authors;
9pub mod book;
10pub mod chapter;
11pub mod entry;
12
13#[jacquard_derive::lexicon]
14#[derive(
15    serde::Serialize,
16    serde::Deserialize,
17    Debug,
18    Clone,
19    PartialEq,
20    Eq,
21    jacquard_derive::IntoStatic
22)]
23#[serde(rename_all = "camelCase")]
24pub struct AuthorListView<'a> {
25    #[serde(skip_serializing_if = "std::option::Option::is_none")]
26    #[serde(borrow)]
27    pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
28    pub index: i64,
29    #[serde(skip_serializing_if = "std::option::Option::is_none")]
30    #[serde(borrow)]
31    pub record: std::option::Option<jacquard_common::types::value::Data<'a>>,
32    #[serde(skip_serializing_if = "std::option::Option::is_none")]
33    #[serde(borrow)]
34    pub uri: std::option::Option<jacquard_common::types::string::AtUri<'a>>,
35}
36
37#[jacquard_derive::lexicon]
38#[derive(
39    serde::Serialize,
40    serde::Deserialize,
41    Debug,
42    Clone,
43    PartialEq,
44    Eq,
45    jacquard_derive::IntoStatic
46)]
47#[serde(rename_all = "camelCase")]
48pub struct BookEntryRef<'a> {
49    #[serde(borrow)]
50    pub entry: crate::sh_weaver::notebook::EntryView<'a>,
51}
52
53///An ordered entry in a Weaver notebook.
54#[jacquard_derive::lexicon]
55#[derive(
56    serde::Serialize,
57    serde::Deserialize,
58    Debug,
59    Clone,
60    PartialEq,
61    Eq,
62    jacquard_derive::IntoStatic
63)]
64#[serde(rename_all = "camelCase")]
65pub struct BookEntryView<'a> {
66    #[serde(borrow)]
67    pub entry: crate::sh_weaver::notebook::EntryView<'a>,
68    pub index: i64,
69    #[serde(skip_serializing_if = "std::option::Option::is_none")]
70    #[serde(borrow)]
71    pub next: std::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
72    #[serde(skip_serializing_if = "std::option::Option::is_none")]
73    #[serde(borrow)]
74    pub prev: std::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
75}
76
77///The format of the content. This is used to determine how to render the content.
78#[jacquard_derive::lexicon]
79#[derive(
80    serde::Serialize,
81    serde::Deserialize,
82    Debug,
83    Clone,
84    PartialEq,
85    Eq,
86    jacquard_derive::IntoStatic
87)]
88#[serde(rename_all = "camelCase")]
89pub struct ContentFormat<'a> {
90    ///The format of the content. This is used to determine how to render the content.
91    #[serde(skip_serializing_if = "std::option::Option::is_none")]
92    #[serde(borrow)]
93    pub markdown: std::option::Option<jacquard_common::CowStr<'a>>,
94}
95
96#[jacquard_derive::lexicon]
97#[derive(
98    serde::Serialize,
99    serde::Deserialize,
100    Debug,
101    Clone,
102    PartialEq,
103    Eq,
104    jacquard_derive::IntoStatic
105)]
106#[serde(rename_all = "camelCase")]
107pub struct EntryView<'a> {
108    #[serde(skip_serializing_if = "std::option::Option::is_none")]
109    #[serde(borrow)]
110    pub authors: std::option::Option<crate::sh_weaver::notebook::AuthorListView<'a>>,
111    #[serde(borrow)]
112    pub cid: jacquard_common::types::string::Cid<'a>,
113    pub indexed_at: jacquard_common::types::string::Datetime,
114    #[serde(borrow)]
115    pub record: jacquard_common::types::value::Data<'a>,
116    #[serde(skip_serializing_if = "std::option::Option::is_none")]
117    #[serde(borrow)]
118    pub rendered_view: std::option::Option<crate::sh_weaver::notebook::RenderedView<'a>>,
119    #[serde(skip_serializing_if = "std::option::Option::is_none")]
120    #[serde(borrow)]
121    pub tags: std::option::Option<crate::sh_weaver::notebook::Tags<'a>>,
122    #[serde(skip_serializing_if = "std::option::Option::is_none")]
123    #[serde(borrow)]
124    pub title: std::option::Option<crate::sh_weaver::notebook::Title<'a>>,
125    #[serde(borrow)]
126    pub uri: jacquard_common::types::string::AtUri<'a>,
127}
128
129#[jacquard_derive::lexicon]
130#[derive(
131    serde::Serialize,
132    serde::Deserialize,
133    Debug,
134    Clone,
135    PartialEq,
136    Eq,
137    jacquard_derive::IntoStatic
138)]
139#[serde(rename_all = "camelCase")]
140pub struct NotebookView<'a> {
141    #[serde(skip_serializing_if = "std::option::Option::is_none")]
142    #[serde(borrow)]
143    pub authors: std::option::Option<crate::sh_weaver::notebook::AuthorListView<'a>>,
144    #[serde(borrow)]
145    pub cid: jacquard_common::types::string::Cid<'a>,
146    pub indexed_at: jacquard_common::types::string::Datetime,
147    #[serde(borrow)]
148    pub record: jacquard_common::types::value::Data<'a>,
149    #[serde(skip_serializing_if = "std::option::Option::is_none")]
150    #[serde(borrow)]
151    pub tags: std::option::Option<crate::sh_weaver::notebook::Tags<'a>>,
152    #[serde(skip_serializing_if = "std::option::Option::is_none")]
153    #[serde(borrow)]
154    pub title: std::option::Option<crate::sh_weaver::notebook::Title<'a>>,
155    #[serde(borrow)]
156    pub uri: jacquard_common::types::string::AtUri<'a>,
157}
158
159///View of a rendered and cached notebook entry
160#[jacquard_derive::lexicon]
161#[derive(
162    serde::Serialize,
163    serde::Deserialize,
164    Debug,
165    Clone,
166    PartialEq,
167    Eq,
168    jacquard_derive::IntoStatic
169)]
170#[serde(rename_all = "camelCase")]
171pub struct RenderedView<'a> {
172    #[serde(skip_serializing_if = "std::option::Option::is_none")]
173    #[serde(borrow)]
174    pub css: std::option::Option<jacquard_common::types::blob::Blob<'a>>,
175    #[serde(borrow)]
176    pub html: jacquard_common::types::blob::Blob<'a>,
177}
178
179///An array of tags associated with the notebook entry. Tags can help categorize and organize entries.
180pub type Tags<'a> = Vec<jacquard_common::CowStr<'a>>;
181///The title of the notebook entry.
182pub type Title<'a> = jacquard_common::CowStr<'a>;