summaryrefslogtreecommitdiff
path: root/src/directive/calendar.rs
blob: a3d199a3efa7fdb1c600cc13158a5eab34fe935a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use crate::directive::DirectiveImplementation;
use crate::error::SiteError;
use crate::page::PageMeta;
use crate::site::Site;
use crate::wikitext::ParsedDirective;

#[derive(Debug, Default, Eq, PartialEq)]
pub struct Calendar {}

impl DirectiveImplementation for Calendar {
    const REQUIRED: &'static [&'static str] = &[];
    const ALLOWED: &'static [&'static str] = &[
        "type",
        "pages",
        "year",
        "month",
        "week_start_day",
        "months_per_row",
        "archivebase",
    ];
    const ALLOW_ANY_UNNAMED: bool = true;

    fn from_parsed(_: &ParsedDirective) -> Self {
        Self::default()
    }

    fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> {
        Err(SiteError::UnimplementedDirective("calendar".into()))
    }
}