diff options
Diffstat (limited to 'src/directive/brokenlinks.rs')
-rw-r--r-- | src/directive/brokenlinks.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/directive/brokenlinks.rs b/src/directive/brokenlinks.rs new file mode 100644 index 0000000..b95c0aa --- /dev/null +++ b/src/directive/brokenlinks.rs @@ -0,0 +1,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() + ); + Ok(Processed::Markdown("\n".into())) + } +} |