From f9a44d742ebae5bc95981d4faa28c1d8d6018150 Mon Sep 17 00:00:00 2001 From: slonkazoid Date: Thu, 18 Apr 2024 04:12:03 +0300 Subject: [PATCH] switch to yaml cuz forgejo --- Cargo.lock | 12 +----------- Cargo.toml | 2 +- README.md | 6 +++--- src/error.rs | 5 +---- src/post/mod.rs | 5 ++--- themes/Catppuccin Mocha.tmTheme | 25 ++++++++++++++++++++++++- 6 files changed, 32 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1e020b4..6b87922 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -789,7 +789,6 @@ checksum = "da11047dc6b6b3f21012056a0f9177e435a0ce4f34e1c5e7990b01342c0d4e49" dependencies = [ "serde", "serde_yaml", - "toml 0.5.11", ] [[package]] @@ -1857,7 +1856,7 @@ dependencies = [ "thiserror", "tokio", "tokio-util", - "toml 0.8.12", + "toml", "tower-http", "tracing", "tracing-subscriber", @@ -2104,15 +2103,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - [[package]] name = "toml" version = "0.8.12" diff --git a/Cargo.toml b/Cargo.toml index 57e70ae..6847f60 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ clap = { version = "4.5.4", features = ["derive"], optional = true } color-eyre = "0.6.3" comrak = { version = "0.22.0", features = ["syntect"] } console-subscriber = { version = "0.2.0", optional = true } -fronma = { version = "0.2.0", features = ["toml"] } +fronma = "0.2.0" futures-util = "0.3.30" notify = "6.1.1" scc = "2.1.0" diff --git a/README.md b/README.md index 225d963..8752d80 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ --- -title = "README" -description = "the README.md file of this project" -author = "slonkazoid" +title: "README" +description: "the README.md file of this project" +author: "slonkazoid" --- # silly-blog diff --git a/src/error.rs b/src/error.rs index 2c34be4..a40ad07 100644 --- a/src/error.rs +++ b/src/error.rs @@ -16,10 +16,7 @@ impl Display for FronmaBalls { match &self.0 { fronma::error::Error::MissingBeginningLine => f.write_str("missing beginning line"), fronma::error::Error::MissingEndingLine => f.write_str("missing ending line"), - fronma::error::Error::SerdeYaml(_) => { - unimplemented!("no yaml allowed in this household") - } - fronma::error::Error::Toml(toml_error) => write!(f, "{}", toml_error), + fronma::error::Error::SerdeYaml(yaml_error) => write!(f, "{}", yaml_error), } } } diff --git a/src/post/mod.rs b/src/post/mod.rs index 152e8e1..a315fbd 100644 --- a/src/post/mod.rs +++ b/src/post/mod.rs @@ -6,8 +6,7 @@ use std::time::{Duration, Instant, SystemTime}; use askama::Template; use chrono::{DateTime, Utc}; -use fronma::engines::Toml; -use fronma::parser::{parse_with_engine, ParsedData}; +use fronma::parser::{parse, ParsedData}; use serde::{Deserialize, Serialize}; use tokio::fs; use tokio::io::AsyncReadExt; @@ -113,7 +112,7 @@ impl PostManager { let mut content = String::with_capacity(stat.len() as usize); file.read_to_string(&mut content).await?; - let ParsedData { headers, body } = parse_with_engine::(&content)?; + let ParsedData { headers, body } = parse::(&content)?; let metadata = headers.into_full(name.to_owned(), created, Some(modified)); let parsing = parsing_start.elapsed(); diff --git a/themes/Catppuccin Mocha.tmTheme b/themes/Catppuccin Mocha.tmTheme index 364617b..a5a962b 100644 --- a/themes/Catppuccin Mocha.tmTheme +++ b/themes/Catppuccin Mocha.tmTheme @@ -1,5 +1,28 @@ + name @@ -2018,4 +2041,4 @@ - \ No newline at end of file +