aboutsummaryrefslogtreecommitdiff
path: root/code/src
diff options
context:
space:
mode:
Diffstat (limited to 'code/src')
-rw-r--r--code/src/main.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/code/src/main.rs b/code/src/main.rs
index bbc0e89..6e281df 100644
--- a/code/src/main.rs
+++ b/code/src/main.rs
@@ -56,7 +56,8 @@ fn scaffold(title: String, body: impl Render) -> impl Render {
),
body!(
nav!(h2!("metamuffin's blog"), a!(href = "./index.html", "index")),
- article!(body)
+ article!(body),
+ footer!(p!("written by metamuffin, licensed under CC-BY-ND-4.0"))
)
)
}
@@ -116,15 +117,15 @@ fn blocks_to_html(blocks: Vec<Block>) -> String {
let mut out = String::new();
for e in blocks {
out += match e {
- markdown::Block::Header(text, level) => {
+ Block::Header(text, level) => {
format!("<h{level}>{}</h{level}>", span_to_html(text))
}
- markdown::Block::Paragraph(p) => format!("<p>{}</p>", span_to_html(p)),
- markdown::Block::Blockquote(q) => format!("<quote>{}</quote>", blocks_to_html(q)),
- markdown::Block::CodeBlock(_syntax, content) => {
+ Block::Paragraph(p) => format!("<p>{}</p>", span_to_html(p)),
+ Block::Blockquote(q) => format!("<quote>{}</quote>", blocks_to_html(q)),
+ Block::CodeBlock(_syntax, content) => {
format!("<code><pre>{}</pre></code>", escape(&content)) // TODO syntax highlighting
}
- markdown::Block::OrderedList(els, _) => format!(
+ Block::OrderedList(els, _) => format!(
"<ol>{}</ol>",
els.into_iter()
.map(|e| format!(
@@ -137,7 +138,7 @@ fn blocks_to_html(blocks: Vec<Block>) -> String {
.collect::<Vec<_>>()
.join("")
),
- markdown::Block::UnorderedList(els) => {
+ Block::UnorderedList(els) => {
format!(
"<ul>{}</ul>",
els.into_iter()
@@ -152,8 +153,8 @@ fn blocks_to_html(blocks: Vec<Block>) -> String {
.join("")
)
}
- markdown::Block::Raw(r) => r,
- markdown::Block::Hr => format!("<hr/>"),
+ Block::Raw(r) => r,
+ Block::Hr => format!("<hr/>"),
}
.as_str();
}