Improve code blocks
This commit is contained in:
parent
2063037bb2
commit
e675344b23
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -218,7 +218,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "md-docs"
|
name = "md-docs"
|
||||||
version = "0.1.0"
|
version = "0.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"markdown",
|
"markdown",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "md-docs"
|
name = "md-docs"
|
||||||
version = "0.1.0"
|
version = "0.1.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
@ -15,9 +15,9 @@ impl Printable for Code {
|
|||||||
return generate_nav_html(&self.value);
|
return generate_nav_html(&self.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
format!("<pre class=\"language-{}\">{}</pre>", lang, code)
|
format!("<pre><code class=\"language-{}\">{}</code></pre>", lang, code)
|
||||||
} else {
|
} else {
|
||||||
format!("<pre class=\"language-none\">{}</pre>", code)
|
format!("<pre><code>{}</code></pre>", code)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,14 @@ mod sidebar;
|
|||||||
mod utils;
|
mod utils;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
// get args
|
||||||
|
let args: Vec<String> = std::env::args().collect();
|
||||||
|
// if first arg is --version, print version and exit
|
||||||
|
if args.len() > 1 && args[1] == "--version" {
|
||||||
|
println!("md-docs {}", env!("CARGO_PKG_VERSION"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let config_file = Path::new(CONFIG_NAME);
|
let config_file = Path::new(CONFIG_NAME);
|
||||||
if !config_file.is_file() {
|
if !config_file.is_file() {
|
||||||
eprintln!("A {} file was not found. Aborting.", CONFIG_NAME);
|
eprintln!("A {} file was not found. Aborting.", CONFIG_NAME);
|
||||||
|
Loading…
Reference in New Issue
Block a user