summaryrefslogtreecommitdiffstats
path: root/src/pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/pandoc')
-rw-r--r--src/pandoc/types.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/pandoc/types.rs b/src/pandoc/types.rs
new file mode 100644
index 0000000..dc5be64
--- /dev/null
+++ b/src/pandoc/types.rs
@@ -0,0 +1,39 @@
1use crate::pandoc::{Block, Inline};
2
3#[derive(Debug, Clone)]
4pub(super) struct Class {
5 inners: Vec<Inner>,
6}
7
8#[derive(Debug, Clone)]
9struct Inner {
10 kind: InnerKind,
11 name: String,
12 //refid: String
13}
14
15#[derive(Debug, Clone)]
16enum InnerKind {
17 Class,
18 Enum,
19}
20
21impl std::fmt::Display for InnerKind {
22 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23 match self {
24 InnerKind::Class => write!(f, "class"),
25 InnerKind::Enum => write!(f, "enum"),
26 }
27 }
28}
29
30impl From<Inner> for (Vec<Inline>, Vec<Vec<Block>>) {
31 fn from(inner: Inner) -> (Vec<Inline>, Vec<Vec<Block>>) {
32 (
33 vec![Inline::Str(inner.name)],
34 vec![vec![Block::Plain(vec![Inline::Str(
35 inner.kind.to_string(),
36 )])]],
37 )
38 }
39}