Skip to main content

oak_rst/language/
mod.rs

1use oak_core::{Language, LanguageCategory};
2
3/// The reStructuredText language definition for Oaks.
4#[derive(Debug, Clone, Default)]
5pub struct RstLanguage {
6    /// Whether to allow directives.
7    pub allow_directives: bool,
8    /// Whether to allow substitutions.
9    pub allow_substitutions: bool,
10    /// Whether to allow roles.
11    pub allow_roles: bool,
12    /// Whether to allow footnotes.
13    pub allow_footnotes: bool,
14    /// Whether to allow citations.
15    pub allow_citations: bool,
16    /// Whether to allow admonitions.
17    pub allow_admonitions: bool,
18}
19
20impl Language for RstLanguage {
21    const NAME: &'static str = "restructuredtext";
22    const CATEGORY: LanguageCategory = LanguageCategory::Markup;
23
24    type TokenType = crate::lexer::token_type::RstTokenType;
25    type ElementType = crate::parser::element_type::RstElementType;
26    type TypedRoot = crate::ast::RstRoot;
27}