Compare commits
2 Commits
48efd906d8
...
579ed554c2
Author | SHA1 | Date |
---|---|---|
xfnw | 579ed554c2 | |
xfnw | 90e182302c |
|
@ -51,6 +51,12 @@ dependencies = [
|
|||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "chrono"
|
||||
version = "0.4.38"
|
||||
|
@ -242,9 +248,9 @@ checksum = "47f142fe24a9c9944451e8349de0a56af5f3e7226dc46f3ed4d4ecc0b85af75e"
|
|||
|
||||
[[package]]
|
||||
name = "jobserver"
|
||||
version = "0.1.30"
|
||||
version = "0.1.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "685a7d121ee3f65ae4fddd72b25a04bb36b6af81bc0828f7d5434c0fe60fa3a2"
|
||||
checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
@ -349,16 +355,16 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
|||
|
||||
[[package]]
|
||||
name = "orgize"
|
||||
version = "0.10.0-alpha.7"
|
||||
version = "0.10.0-alpha.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ea5322d38d3853e1af919df6e74a58ed769b99814c1cd76ee2f122a0d7e53d9"
|
||||
checksum = "009f43f97cf8a1daf55baa7f0cf8a125cfea13cfbc30f492991203dfdfe39c62"
|
||||
dependencies = [
|
||||
"bytecount",
|
||||
"cfg-if",
|
||||
"jetscii",
|
||||
"memchr",
|
||||
"nom",
|
||||
"rowan",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -367,12 +373,6 @@ version = "2.3.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-lite"
|
||||
version = "0.2.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"
|
||||
|
||||
[[package]]
|
||||
name = "pkg-config"
|
||||
version = "0.3.30"
|
||||
|
@ -526,37 +526,6 @@ dependencies = [
|
|||
"winnow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing"
|
||||
version = "0.1.40"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
|
||||
dependencies = [
|
||||
"pin-project-lite",
|
||||
"tracing-attributes",
|
||||
"tracing-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-attributes"
|
||||
version = "0.1.27"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-core"
|
||||
version = "0.1.32"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicase"
|
||||
version = "2.7.0"
|
||||
|
|
|
@ -12,7 +12,7 @@ chrono = { version = "0.4.35", default-features = false }
|
|||
clap = { version = "4.5.3", default-features = false, features = ["derive", "std", "help", "usage"] }
|
||||
git2 = { version = "0.18.3", default-features = false }
|
||||
html-escaper = "0.2.0"
|
||||
orgize = "=0.10.0-alpha.7"
|
||||
orgize = "=0.10.0-alpha.8"
|
||||
rowan = "0.15.15"
|
||||
serde = { version = "1.0.197", default-features = false }
|
||||
serde_derive = { version = "1.0.197" }
|
||||
|
|
12
src/html.rs
12
src/html.rs
|
@ -2,7 +2,7 @@ use crate::git::{CreateMap, ModifyMap};
|
|||
use chrono::{DateTime, Datelike, NaiveDateTime};
|
||||
use html_escaper::{Escape, Trusted};
|
||||
use orgize::{
|
||||
ast::{Keyword, PropertyDrawer, TodoType},
|
||||
ast::{PropertyDrawer, TodoType},
|
||||
export::{Container, Event, HtmlEscape, HtmlExport, TraversalContext, Traverser},
|
||||
ParseConfig,
|
||||
};
|
||||
|
@ -198,15 +198,7 @@ pub fn generate_page(
|
|||
let fstr = std::str::from_utf8(file)?;
|
||||
let res = org_cfg.clone().parse(fstr);
|
||||
|
||||
// https://github.com/PoiScript/orgize/issues/70#issuecomment-1916068875
|
||||
let mut title = "untitled".to_string();
|
||||
if let Some(section) = res.document().section() {
|
||||
for keyword in support::children::<Keyword>(section.syntax()) {
|
||||
if keyword.key().eq_ignore_ascii_case("TITLE") {
|
||||
title = keyword.value().trim().to_string();
|
||||
}
|
||||
}
|
||||
}
|
||||
let title = res.document().title().unwrap_or_else(|| "untitled".to_string());
|
||||
|
||||
let (created, author) = ctime.get(&full_path).ok_or("missing creation time")?;
|
||||
let modified = mtime.get(&full_path).ok_or("missing modification time")?.0;
|
||||
|
|
Loading…
Reference in New Issue