Skip to content

Commit

Permalink
Merge pull request cobalt-org#1140 from epage/vim
Browse files Browse the repository at this point in the history
fix!: Remove vimwiki support
  • Loading branch information
epage authored Jun 2, 2023
2 parents cba6184 + 41cbe77 commit 06aa83e
Show file tree
Hide file tree
Showing 18 changed files with 9 additions and 613 deletions.
345 changes: 6 additions & 339 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ normalize-line-endings = "0.3.0"
sitemap = "0.4"
open = "4"
dunce = "1.0.4"
vimwiki = { version = "0.1", features = ["html"] }

file-serve = { version = "0.2.3", path = "crates/file-serve", optional = true }
notify = { version = "6", optional = true, default-features = false, features = ["macos_fsevent"] }
Expand All @@ -106,6 +105,7 @@ sass-rs = { version = "0.2", optional = true }
html-minifier = {version="3.0", optional = true }
anyhow = "1.0.71"
anstream = "0.3.2"
chrono = "0.4.26"

[dev-dependencies]
trycmd = "0.14"
Expand Down
2 changes: 0 additions & 2 deletions crates/config/src/frontmatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ impl Frontmatter {

let format = match split_name.1 {
Some("md") => SourceFormat::Markdown,
Some("wiki") => SourceFormat::Vimwiki,
_ => SourceFormat::Raw,
};
self.format.get_or_insert(format);
Expand Down Expand Up @@ -284,7 +283,6 @@ pub enum SourceFormat {
#[default]
Raw,
Markdown,
Vimwiki,
#[cfg(not(feature = "unstable"))]
#[doc(hidden)]
#[serde(other)]
Expand Down
6 changes: 0 additions & 6 deletions src/cobalt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ struct Context {
pub layouts: HashMap<String, String>,
pub liquid: cobalt_model::Liquid,
pub markdown: cobalt_model::Markdown,
pub vimwiki: cobalt_model::Vimwiki,
pub assets: cobalt_model::Assets,
pub minify: Minify,
}
Expand All @@ -50,7 +49,6 @@ impl Context {
layouts_path,
liquid,
markdown,
vimwiki,
syntax: _,
assets,
minify,
Expand All @@ -60,7 +58,6 @@ impl Context {
let site_attributes = site.load(&source)?;
let liquid = liquid.build()?;
let markdown = markdown.build();
let vimwiki = vimwiki.build();
let assets = assets.build()?;

let layouts = find_layouts(&layouts_path)?;
Expand All @@ -78,7 +75,6 @@ impl Context {
layouts,
liquid,
markdown,
vimwiki,
assets,
minify,
};
Expand Down Expand Up @@ -205,7 +201,6 @@ fn generate_doc(
let render_context = RenderContext {
parser: &context.liquid,
markdown: &context.markdown,
vimwiki: &context.vimwiki,
globals: &globals,
minify: context.minify.clone(),
};
Expand All @@ -226,7 +221,6 @@ fn generate_doc(
let render_context = RenderContext {
parser: &context.liquid,
markdown: &context.markdown,
vimwiki: &context.vimwiki,
globals: &globals,
minify: context.minify.clone(),
};
Expand Down
7 changes: 0 additions & 7 deletions src/cobalt_model/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use super::collection;
use super::mark;
use super::site;
use super::template;
use super::vwiki;
use crate::SyntaxHighlight;

#[derive(Debug, Clone, Serialize)]
Expand All @@ -29,7 +28,6 @@ pub struct Config {
pub layouts_path: path::PathBuf,
pub liquid: template::LiquidBuilder,
pub markdown: mark::MarkdownBuilder,
pub vimwiki: vwiki::VimwikiBuilder,
#[serde(skip)]
pub syntax: std::sync::Arc<SyntaxHighlight>,
pub assets: assets::AssetsBuilder,
Expand Down Expand Up @@ -120,10 +118,6 @@ impl Config {
.enabled
.then(|| syntax_highlight.theme.clone()),
};
let vimwiki = vwiki::VimwikiBuilder {
theme: syntax_highlight.theme,
syntax_highlight_enabled: syntax_highlight.enabled,
};

let config = Config {
source,
Expand All @@ -137,7 +131,6 @@ impl Config {
layouts_path,
liquid,
markdown,
vimwiki,
syntax,
assets,
minify,
Expand Down
3 changes: 0 additions & 3 deletions src/cobalt_model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ mod mark;
mod sass;
mod site;
mod template;
mod vwiki;

pub mod files;
pub mod pagination;
Expand All @@ -33,5 +32,3 @@ pub use self::sass::SassCompiler;
pub use self::site::Site;
pub use self::template::Liquid;
pub use self::template::LiquidBuilder;
pub use self::vwiki::Vimwiki;
pub use self::vwiki::VimwikiBuilder;
52 changes: 0 additions & 52 deletions src/cobalt_model/vwiki.rs

This file was deleted.

8 changes: 2 additions & 6 deletions src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use crate::error::*;
pub struct RenderContext<'a> {
pub parser: &'a cobalt_model::Liquid,
pub markdown: &'a cobalt_model::Markdown,
pub vimwiki: &'a cobalt_model::Vimwiki,
pub globals: &'a Object,
pub minify: Minify,
}
Expand Down Expand Up @@ -272,7 +271,7 @@ impl Document {
let mut url = sitemap::structs::UrlEntry::builder();
url = url.loc(link);
if let Some(date) = self.front.published_date {
let date = vimwiki::vendor::chrono::DateTime::parse_from_rfc2822(&date.to_rfc2822())
let date = chrono::DateTime::parse_from_rfc2822(&date.to_rfc2822())
.expect("chrono/time compatible RFC 2822 implementations");
url = url.lastmod(date);
}
Expand Down Expand Up @@ -317,7 +316,6 @@ impl Document {
let html = match self.front.format {
cobalt_model::SourceFormat::Raw => html,
cobalt_model::SourceFormat::Markdown => context.markdown.parse(&html)?,
cobalt_model::SourceFormat::Vimwiki => context.vimwiki.parse(&html)?,
};

Ok(html)
Expand Down Expand Up @@ -436,8 +434,6 @@ fn extract_excerpt(
cobalt_model::SourceFormat::Markdown => {
extract_excerpt_markdown(content, excerpt_separator)
}
cobalt_model::SourceFormat::Vimwiki | cobalt_model::SourceFormat::Raw => {
extract_excerpt_raw(content, excerpt_separator)
}
cobalt_model::SourceFormat::Raw => extract_excerpt_raw(content, excerpt_separator),
}
}
3 changes: 0 additions & 3 deletions tests/cmd/vimwiki_not_templated.in/_cobalt.yml

This file was deleted.

11 changes: 0 additions & 11 deletions tests/cmd/vimwiki_not_templated.in/_layouts/default.liquid

This file was deleted.

25 changes: 0 additions & 25 deletions tests/cmd/vimwiki_not_templated.in/index.wiki

This file was deleted.

15 changes: 0 additions & 15 deletions tests/cmd/vimwiki_not_templated.md

This file was deleted.

46 changes: 0 additions & 46 deletions tests/cmd/vimwiki_not_templated.out/_dest/index.html

This file was deleted.

2 changes: 0 additions & 2 deletions tests/cmd/vimwiki_not_templated_no_syntax.in/_cobalt.yml

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions tests/cmd/vimwiki_not_templated_no_syntax.in/index.wiki

This file was deleted.

15 changes: 0 additions & 15 deletions tests/cmd/vimwiki_not_templated_no_syntax.md

This file was deleted.

Loading

0 comments on commit 06aa83e

Please sign in to comment.