aboutsummaryrefslogtreecommitdiff
path: root/src/models/text.rs
diff options
context:
space:
mode:
authorGravatar Jake Swenson <jakeswenson@users.noreply.github.com> 2021-08-28 10:14:39 -0700
committerGravatar GitHub <noreply@github.com> 2021-08-28 17:14:39 +0000
commitc9266553610fd48a66048d9169da4703a0c71716 (patch)
tree0d65a763f646d8b213411328d56b99620123edc2 /src/models/text.rs
parent4fa6f626a0fc571b0293d63da78ca37b4e359af1 (diff)
downloadnotion-c9266553610fd48a66048d9169da4703a0c71716.tar.gz
notion-c9266553610fd48a66048d9169da4703a0c71716.tar.zst
notion-c9266553610fd48a66048d9169da4703a0c71716.zip
Number format parsing bug. Fixes #15 (#16)
Diffstat (limited to 'src/models/text.rs')
-rw-r--r--src/models/text.rs36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/models/text.rs b/src/models/text.rs
index f7ea2b6..b960b6d 100644
--- a/src/models/text.rs
+++ b/src/models/text.rs
@@ -25,35 +25,35 @@ pub enum TextColor {
}
/// Rich text annotations
-/// See https://developers.notion.com/reference/rich-text#annotations
+/// See <https://developers.notion.com/reference/rich-text#annotations>
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Clone)]
-struct Annotations {
- bold: Option<bool>,
- code: Option<bool>,
- color: Option<TextColor>,
- italic: Option<bool>,
- strikethrough: Option<bool>,
- underline: Option<bool>,
+pub struct Annotations {
+ pub bold: Option<bool>,
+ pub code: Option<bool>,
+ pub color: Option<TextColor>,
+ pub italic: Option<bool>,
+ pub strikethrough: Option<bool>,
+ pub underline: Option<bool>,
}
/// Properties common on all rich text objects
-/// See https://developers.notion.com/reference/rich-text#all-rich-text
+/// See <https://developers.notion.com/reference/rich-text#all-rich-text>
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Clone)]
pub struct RichTextCommon {
- plain_text: String,
- href: Option<String>,
- annotations: Option<Annotations>,
+ pub plain_text: String,
+ pub href: Option<String>,
+ pub annotations: Option<Annotations>,
}
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
pub struct Link {
- url: String,
+ pub url: String,
}
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Clone)]
pub struct Text {
- content: String,
- link: Option<String>,
+ pub content: String,
+ pub link: Option<String>,
}
/// Rich text objects contain data for displaying formatted text, mentions, and equations.
@@ -64,18 +64,18 @@ pub struct Text {
#[serde(tag = "type")]
#[serde(rename_all = "snake_case")]
pub enum RichText {
- /// See https://developers.notion.com/reference/rich-text#text-objects
+ /// See <https://developers.notion.com/reference/rich-text#text-objects>
Text {
#[serde(flatten)]
rich_text: RichTextCommon,
text: Text,
},
- /// See https://developers.notion.com/reference/rich-text#mention-objects
+ /// See <https://developers.notion.com/reference/rich-text#mention-objects>
Mention {
#[serde(flatten)]
rich_text: RichTextCommon,
},
- /// See https://developers.notion.com/reference/rich-text#equation-objects
+ /// See <https://developers.notion.com/reference/rich-text#equation-objects>
Equation {
#[serde(flatten)]
rich_text: RichTextCommon,