Update dependencies
This commit is contained in:
2009
Cargo.lock
generated
2009
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
20
Cargo.toml
20
Cargo.toml
@@ -5,27 +5,27 @@ authors = ["Adrian Kuschelyagi Malacoda <adrian.malacoda@monarch-pass.net>"]
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
pulldown-cmark = "0.9.2"
|
pulldown-cmark = "0.13.0"
|
||||||
tera = "1.17.1"
|
tera = "1.20.0"
|
||||||
toml = "0.4.2"
|
toml = "0.8.23"
|
||||||
grep = "0.2"
|
grep = "0.3.2"
|
||||||
regex = "1.10.5"
|
regex = "1.11.1"
|
||||||
pathdiff = "0.2.1"
|
pathdiff = "0.2.3"
|
||||||
|
|
||||||
[dependencies.chrono]
|
[dependencies.chrono]
|
||||||
version = "0.4.38"
|
version = "0.4.41"
|
||||||
features = ["serde"]
|
features = ["serde"]
|
||||||
|
|
||||||
[dependencies.git2]
|
[dependencies.git2]
|
||||||
version = "0.19.0"
|
version = "0.20.2"
|
||||||
default-features = false
|
default-features = false
|
||||||
|
|
||||||
[dependencies.clap]
|
[dependencies.clap]
|
||||||
version = "4.0.29"
|
version = "4.5.40"
|
||||||
features = ["derive"]
|
features = ["derive"]
|
||||||
|
|
||||||
[dependencies.rocket]
|
[dependencies.rocket]
|
||||||
version = "0.5.0-rc.2"
|
version = "0.5.1"
|
||||||
features = ["json"]
|
features = ["json"]
|
||||||
|
|
||||||
[dependencies.serde]
|
[dependencies.serde]
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ impl Historian {
|
|||||||
let site_config = match fs::metadata(&toml_path) {
|
let site_config = match fs::metadata(&toml_path) {
|
||||||
Err(_) => Table::new(),
|
Err(_) => Table::new(),
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
let toml_data = fs::read(&toml_path).unwrap();
|
let toml_data = fs::read_to_string(&toml_path).unwrap();
|
||||||
toml::de::from_slice(&toml_data).unwrap()
|
toml::de::from_str(&toml_data).unwrap()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -532,9 +532,9 @@ fn export_wiki_page(historian: &Historian, renderer: &PageRenderer, name: &str,
|
|||||||
};
|
};
|
||||||
|
|
||||||
println!("export: {} to {:?}", page.full_name, page_html_output_path);
|
println!("export: {} to {:?}", page.full_name, page_html_output_path);
|
||||||
let page_html = renderer.render_page_template("page.html", historian, &page, toml! {
|
let page_html = renderer.render_page_template("page.html", historian, &page, &toml! {
|
||||||
dynamic = false
|
dynamic = false
|
||||||
}.as_table().unwrap()).replace(".md", ".html");
|
}).replace(".md", ".html");
|
||||||
|
|
||||||
let mut page_html_file = fs::File::create(page_html_output_path).unwrap();
|
let mut page_html_file = fs::File::create(page_html_output_path).unwrap();
|
||||||
page_html_file.write_all(page_html.as_bytes());
|
page_html_file.write_all(page_html.as_bytes());
|
||||||
@@ -545,7 +545,6 @@ fn export_wiki_page(historian: &Historian, renderer: &PageRenderer, name: &str,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for child in page.children {
|
for child in page.children {
|
||||||
// let child_path = page_path.join(child);
|
|
||||||
export_wiki_page(historian, renderer, child.path.to_str().unwrap(), output_path);
|
export_wiki_page(historian, renderer, child.path.to_str().unwrap(), output_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
30
src/main.rs
30
src/main.rs
@@ -43,17 +43,17 @@ async fn page<'r>(
|
|||||||
for (key, value) in query.segments() {
|
for (key, value) in query.segments() {
|
||||||
if key == "action" {
|
if key == "action" {
|
||||||
if value == "edit" {
|
if value == "edit" {
|
||||||
return PageResponder::Page(RawHtml(renderer.render_page_template("edit.html", &historian, &page, toml! {
|
return PageResponder::Page(RawHtml(renderer.render_page_template("edit.html", &historian, &page, &toml! {
|
||||||
dynamic = true
|
dynamic = true
|
||||||
}.as_table().unwrap())))
|
})))
|
||||||
} else if value == "history" {
|
} else if value == "history" {
|
||||||
return PageResponder::Page(RawHtml(renderer.template("history.html")
|
return PageResponder::Page(RawHtml(renderer.template("history.html")
|
||||||
.with_historian(&historian)
|
.with_historian(&historian)
|
||||||
.with_page(&page)
|
.with_page(&page)
|
||||||
.insert("revisions", &historian.get_history_of_page(&page))
|
.insert("revisions", &historian.get_history_of_page(&page))
|
||||||
.insert("options", toml! {
|
.insert("options", &toml! {
|
||||||
dynamic = true
|
dynamic = true
|
||||||
}.as_table().unwrap())
|
})
|
||||||
.render()))
|
.render()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,9 +65,9 @@ async fn page<'r>(
|
|||||||
.with_page(&page)
|
.with_page(&page)
|
||||||
.insert("revision", &revision)
|
.insert("revision", &revision)
|
||||||
.insert("content", &historian.get_page_text_of_revision(&page, &revision).unwrap())
|
.insert("content", &historian.get_page_text_of_revision(&page, &revision).unwrap())
|
||||||
.insert("options", toml! {
|
.insert("options", &toml! {
|
||||||
dynamic = true
|
dynamic = true
|
||||||
}.as_table().unwrap())
|
})
|
||||||
.render()))
|
.render()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,9 +77,9 @@ async fn page<'r>(
|
|||||||
if page.is_directory && !origin.path().ends_with("/") {
|
if page.is_directory && !origin.path().ends_with("/") {
|
||||||
PageResponder::Redirect(Redirect::to(origin.path().as_str().to_owned() + "/"))
|
PageResponder::Redirect(Redirect::to(origin.path().as_str().to_owned() + "/"))
|
||||||
} else {
|
} else {
|
||||||
PageResponder::Page(RawHtml(renderer.render_page(&historian, &page, toml! {
|
PageResponder::Page(RawHtml(renderer.render_page(&historian, &page, &toml! {
|
||||||
dynamic = true
|
dynamic = true
|
||||||
}.as_table().unwrap())))
|
})))
|
||||||
}
|
}
|
||||||
}).or_else(|| {
|
}).or_else(|| {
|
||||||
if let Some(query) = origin.query() {
|
if let Some(query) = origin.query() {
|
||||||
@@ -91,9 +91,9 @@ async fn page<'r>(
|
|||||||
.insert("page", &historian.start_page(path_str))
|
.insert("page", &historian.start_page(path_str))
|
||||||
.insert("content", "")
|
.insert("content", "")
|
||||||
.insert("ancestors", &Vec::<String>::with_capacity(0))
|
.insert("ancestors", &Vec::<String>::with_capacity(0))
|
||||||
.insert("options", toml! {
|
.insert("options", &toml! {
|
||||||
dynamic = true
|
dynamic = true
|
||||||
}.as_table().unwrap())
|
})
|
||||||
.render())))
|
.render())))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -135,9 +135,9 @@ fn action(
|
|||||||
.insert("subaction", action.subaction)
|
.insert("subaction", action.subaction)
|
||||||
.insert("summary", action.summary)
|
.insert("summary", action.summary)
|
||||||
.insert("author", action.author)
|
.insert("author", action.author)
|
||||||
.insert("options", toml! {
|
.insert("options", &toml! {
|
||||||
dynamic = true
|
dynamic = true
|
||||||
}.as_table().unwrap())
|
})
|
||||||
.render()))
|
.render()))
|
||||||
} else {
|
} else {
|
||||||
historian.submit_edit(&page, &Edit {
|
historian.submit_edit(&page, &Edit {
|
||||||
@@ -159,12 +159,12 @@ fn action(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PageResponder::Page(RawHtml(renderer.render_template("message.html", &historian, toml! {
|
PageResponder::Page(RawHtml(renderer.render_template("message.html", &historian, &toml! {
|
||||||
header = "Invalid Action"
|
header = "Invalid Action"
|
||||||
message = "Action was invalid or misunderstood"
|
message = "Action was invalid or misunderstood"
|
||||||
}.as_table().unwrap(), toml! {
|
}, &toml! {
|
||||||
dynamic = true
|
dynamic = true
|
||||||
}.as_table().unwrap())))
|
})))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
|
|||||||
Reference in New Issue
Block a user