summaryrefslogtreecommitdiff
path: root/src/directive/toc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/directive/toc.rs')
-rw-r--r--src/directive/toc.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/directive/toc.rs b/src/directive/toc.rs
new file mode 100644
index 0000000..6db46d2
--- /dev/null
+++ b/src/directive/toc.rs
@@ -0,0 +1,27 @@
+use crate::error::SiteError;
+use crate::page::PageMeta;
+use crate::site::Site;
+use crate::wikitext::ParsedDirective;
+
+#[derive(Debug, Default, Eq, PartialEq)]
+pub struct Toc {}
+
+impl Toc {
+ pub const REQUIRED: &'static [&'static str] = &[];
+ pub const ALLOWED: &'static [&'static str] = &["levels"];
+ pub const ALLOW_ANY_UNNAMED: bool = true;
+
+ pub fn new() -> Self {
+ Self::default()
+ }
+
+ pub fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> {
+ Ok("FIXME:inline".into())
+ }
+}
+
+impl From<ParsedDirective> for Toc {
+ fn from(_p: ParsedDirective) -> Self {
+ Self::new()
+ }
+}