Update layout

This commit is contained in:
ef3d0c3e 2024-07-29 18:06:28 +02:00
parent 30dff576e7
commit a777e0ca8f
2 changed files with 6 additions and 5 deletions

View file

@ -120,7 +120,7 @@ impl Compiler {
) )
.as_str(); .as_str();
} }
result += "</head><body>"; result += r#"</head><body><div id="layout">"#;
// TODO: TOC // TODO: TOC
// TODO: Author, Date, Title, Div // TODO: Author, Date, Title, Div
@ -134,7 +134,7 @@ impl Compiler {
let mut result = String::new(); let mut result = String::new();
match self.target() { match self.target() {
Target::HTML => { Target::HTML => {
result += "</body></html>"; result += "</div></body></html>";
} }
Target::LATEX => todo!(""), Target::LATEX => todo!(""),
} }
@ -148,7 +148,7 @@ impl Compiler {
let header = self.header(document); let header = self.header(document);
// Body // Body
let mut body = String::new(); let mut body = r#"<div id="content">"#.to_string();
for i in 0..borrow.len() { for i in 0..borrow.len() {
let elem = &borrow[i]; let elem = &borrow[i];
@ -157,6 +157,7 @@ impl Compiler {
Err(err) => println!("Unable to compile element: {err}\n{}", elem.to_string()), Err(err) => println!("Unable to compile element: {err}\n{}", elem.to_string()),
} }
} }
body.push_str("</div>");
// Footer // Footer
let footer = self.footer(document); let footer = self.footer(document);

View file

@ -23,7 +23,7 @@ impl NavEntry {
let mut result = String::new(); let mut result = String::new();
match target { match target {
Target::HTML => { Target::HTML => {
result += r#"<ul id="navbar">"#; result += r#"<div id="navbar"><ul>"#;
fn process( fn process(
target: Target, target: Target,
@ -69,7 +69,7 @@ impl NavEntry {
process(target, &categories, true, &mut result, self, 0); process(target, &categories, true, &mut result, self, 0);
result += r#"</ul>"#; result += r#"</ul></div>"#;
} }
_ => todo!(""), _ => todo!(""),
} }