1use oak_core::SyntaxKind;
2use serde::{Deserialize, Serialize};
3
4#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
5pub enum MarkdownSyntaxKind {
6 Text,
8 Whitespace,
9 Newline,
10
11 Heading1,
13 Heading2,
14 Heading3,
15 Heading4,
16 Heading5,
17 Heading6,
18 HeadingText,
19
20 Emphasis, Strong, Strikethrough, InlineCode, CodeBlock, CodeFence, CodeLanguage, Link,
33 LinkText,
34 LinkUrl,
35 LinkTitle,
36 Image,
37 ImageAlt,
38 ImageUrl,
39 ImageTitle,
40
41 UnorderedList,
43 OrderedList,
44 ListItem,
45 ListMarker, TaskList,
47 TaskMarker, Blockquote,
51 BlockquoteMarker, HorizontalRule, Table,
58 TableRow,
59 TableCell,
60 TableHeader,
61 TableSeparator, TableAlignment, HtmlTag,
66 HtmlComment,
67
68 Escape, LeftBracket, RightBracket, LeftParen, RightParen, LeftAngle, RightAngle, Asterisk, Underscore, Backtick, Tilde, Hash, Pipe, Dash, Plus, Dot, Colon, Exclamation, Error,
92
93 Document,
95 Paragraph,
96
97 Eof,
99}
100
101impl SyntaxKind for MarkdownSyntaxKind {
102 fn is_trivia(&self) -> bool {
103 matches!(self, Self::Whitespace | Self::Newline)
104 }
105
106 fn is_comment(&self) -> bool {
107 matches!(self, Self::HtmlComment)
108 }
109
110 fn is_whitespace(&self) -> bool {
111 matches!(self, Self::Whitespace | Self::Newline)
112 }
113
114 fn is_token_type(&self) -> bool {
115 !matches!(self, Self::Document | Self::Paragraph)
116 }
117
118 fn is_element_type(&self) -> bool {
119 matches!(self, Self::Document | Self::Paragraph)
120 }
121}