oino_ui/extras/
markdown.rs1use serde::{Deserialize, Serialize};
4
5use crate::node::{Common, IntoNode, Node};
6
7#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
10#[serde(rename_all = "camelCase")]
11pub struct Markdown {
12 #[serde(flatten)]
14 pub common: Common,
15 pub source: String,
17}
18
19impl Markdown {
20 #[must_use]
22 pub fn new(source: impl Into<String>) -> Self {
23 Self {
24 common: Common::new(),
25 source: source.into(),
26 }
27 }
28}
29
30impl IntoNode for Markdown {}
31impl From<Markdown> for Node {
32 fn from(m: Markdown) -> Self {
33 Node::Markdown(m)
34 }
35}