summaryrefslogtreecommitdiff
path: root/src/directive/brokenlinks.rs
blob: aa135ec461c3d3d81d2e73c8cdbeb3a82663cb19 (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
use crate::directive::{DirectiveError, DirectiveImplementation, Processed};
use crate::page::PageMeta;
use crate::site::Site;
use crate::wikitext::ParsedDirective;
use log::warn;

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

impl DirectiveImplementation for Brokenlinks {
    const REQUIRED: &'static [&'static str] = &["pages"];
    const ALLOWED: &'static [&'static str] = &[];
    const ALLOW_ANY_UNNAMED: bool = false;

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

    fn process(&self, _site: &Site, meta: &mut PageMeta) -> Result<Processed, DirectiveError> {
        warn!(
            "page {} uses unimplemented brokenlinks",
            meta.path().display()
        );
        Err(DirectiveError::UnimplementedDirective("brokenlinks".into()))
    }
}