diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-10-23 08:44:54 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-10-23 08:44:54 +0000 |
commit | 4bf38fbb0374ef4c32bf622e78ba1ec40409d1c2 (patch) | |
tree | 2a72a0fad70d95c0f0b0ab1526b0096442844fb1 | |
parent | 7724c75c0836a2d2c9af815beacd2bee14d723e4 (diff) | |
parent | cb53c9f810ef2c3d34664eae6ff3374dd8a6c644 (diff) | |
download | riki-4bf38fbb0374ef4c32bf622e78ba1ec40409d1c2.tar.gz |
Merge branch 'liw/unimplemented' into 'main'
fix: make unimplemented directives be a runtime error
See merge request larswirzenius/riki!63
-rw-r--r-- | src/directive/brokenlinks.rs | 2 | ||||
-rw-r--r-- | src/directive/calendar.rs | 2 | ||||
-rw-r--r-- | src/directive/format.rs | 2 | ||||
-rw-r--r-- | src/directive/graph.rs | 2 | ||||
-rw-r--r-- | src/directive/inline.rs | 2 | ||||
-rw-r--r-- | src/directive/map.rs | 2 | ||||
-rw-r--r-- | src/directive/pagestats.rs | 2 | ||||
-rw-r--r-- | src/directive/sidebar.rs | 2 | ||||
-rw-r--r-- | src/directive/toc.rs | 2 | ||||
-rw-r--r-- | src/directive/traillink.rs | 2 | ||||
-rw-r--r-- | src/error.rs | 3 |
11 files changed, 13 insertions, 10 deletions
diff --git a/src/directive/brokenlinks.rs b/src/directive/brokenlinks.rs index 3091be9..154ffed 100644 --- a/src/directive/brokenlinks.rs +++ b/src/directive/brokenlinks.rs @@ -16,7 +16,7 @@ impl BrokenLinks { } pub fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> { - Ok("FIXME:inline".into()) + Err(SiteError::UnimplementedDirective("brokenlinks".into())) } } diff --git a/src/directive/calendar.rs b/src/directive/calendar.rs index b24f39b..a11cc52 100644 --- a/src/directive/calendar.rs +++ b/src/directive/calendar.rs @@ -20,7 +20,7 @@ impl Calendar { pub const ALLOW_ANY_UNNAMED: bool = true; pub fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> { - Ok("FIXME:graph".into()) + Err(SiteError::UnimplementedDirective("calendar".into())) } } diff --git a/src/directive/format.rs b/src/directive/format.rs index a40c439..ee9c7ec 100644 --- a/src/directive/format.rs +++ b/src/directive/format.rs @@ -12,7 +12,7 @@ impl Format { pub const ALLOW_ANY_UNNAMED: bool = true; pub fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> { - Ok("FIXME:format".into()) + Err(SiteError::UnimplementedDirective("format".into())) } } diff --git a/src/directive/graph.rs b/src/directive/graph.rs index c8c7480..8234ed2 100644 --- a/src/directive/graph.rs +++ b/src/directive/graph.rs @@ -12,7 +12,7 @@ impl Graph { pub const ALLOW_ANY_UNNAMED: bool = true; pub fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> { - Ok("FIXME:graph".into()) + Err(SiteError::UnimplementedDirective("graph".into())) } } diff --git a/src/directive/inline.rs b/src/directive/inline.rs index 6bc0d1b..7bef13c 100644 --- a/src/directive/inline.rs +++ b/src/directive/inline.rs @@ -31,7 +31,7 @@ impl Inline { } pub fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> { - Ok("FIXME:inline".into()) + Err(SiteError::UnimplementedDirective("inline".into())) } } diff --git a/src/directive/map.rs b/src/directive/map.rs index 20bd222..960b339 100644 --- a/src/directive/map.rs +++ b/src/directive/map.rs @@ -12,7 +12,7 @@ impl Map { pub const ALLOW_ANY_UNNAMED: bool = true; pub fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> { - Ok("FIXME:map".into()) + Err(SiteError::UnimplementedDirective("map".into())) } } diff --git a/src/directive/pagestats.rs b/src/directive/pagestats.rs index 52e6997..89ba57e 100644 --- a/src/directive/pagestats.rs +++ b/src/directive/pagestats.rs @@ -16,7 +16,7 @@ impl PageStats { } pub fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> { - Ok("FIXME:inline".into()) + Err(SiteError::UnimplementedDirective("pagestat".into())) } } diff --git a/src/directive/sidebar.rs b/src/directive/sidebar.rs index b80bfe9..5148086 100644 --- a/src/directive/sidebar.rs +++ b/src/directive/sidebar.rs @@ -12,7 +12,7 @@ impl Sidebar { pub const ALLOW_ANY_UNNAMED: bool = true; pub fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> { - Ok("FIXME:sidebar".into()) + Err(SiteError::UnimplementedDirective("sidebar".into())) } } diff --git a/src/directive/toc.rs b/src/directive/toc.rs index cc94be4..af1bba9 100644 --- a/src/directive/toc.rs +++ b/src/directive/toc.rs @@ -16,7 +16,7 @@ impl Toc { } pub fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> { - Ok("FIXME:inline".into()) + Err(SiteError::UnimplementedDirective("toc".into())) } } diff --git a/src/directive/traillink.rs b/src/directive/traillink.rs index e79ce9e..9acfa6b 100644 --- a/src/directive/traillink.rs +++ b/src/directive/traillink.rs @@ -16,7 +16,7 @@ impl TrailLink { } pub fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> { - Ok("FIXME:traillink".into()) + Err(SiteError::UnimplementedDirective("traillink".into())) } } diff --git a/src/error.rs b/src/error.rs index 922f735..90046b2 100644 --- a/src/error.rs +++ b/src/error.rs @@ -88,6 +88,9 @@ pub enum SiteError { #[error("failed to parse wikitext, line {0}, column {1}: {2:?}")] WikitextSyntax(usize, usize, Vec<crate::token::TokenKind>), + + #[error("directive isn't implemented yet: {0}")] + UnimplementedDirective(String), } impl SiteError { |