summaryrefslogtreecommitdiff
path: root/src/directive/sidebar.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/directive/sidebar.rs')
-rw-r--r--src/directive/sidebar.rs19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/directive/sidebar.rs b/src/directive/sidebar.rs
index 5148086..1c25144 100644
--- a/src/directive/sidebar.rs
+++ b/src/directive/sidebar.rs
@@ -1,3 +1,4 @@
+use crate::directive::{DirectiveImplementation, Processed};
use crate::error::SiteError;
use crate::page::PageMeta;
use crate::site::Site;
@@ -6,18 +7,16 @@ use crate::wikitext::ParsedDirective;
#[derive(Debug, Default, Eq, PartialEq)]
pub struct Sidebar {}
-impl Sidebar {
- pub const REQUIRED: &'static [&'static str] = &[];
- pub const ALLOWED: &'static [&'static str] = &["content"];
- pub const ALLOW_ANY_UNNAMED: bool = true;
+impl DirectiveImplementation for Sidebar {
+ const REQUIRED: &'static [&'static str] = &[];
+ const ALLOWED: &'static [&'static str] = &["content"];
+ const ALLOW_ANY_UNNAMED: bool = true;
- pub fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> {
- Err(SiteError::UnimplementedDirective("sidebar".into()))
+ fn from_parsed(_: &ParsedDirective) -> Self {
+ Self::default()
}
-}
-impl From<&ParsedDirective> for Sidebar {
- fn from(_: &ParsedDirective) -> Self {
- Sidebar::default()
+ fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<Processed, SiteError> {
+ Err(SiteError::UnimplementedDirective("sidebar".into()))
}
}