Compare commits

...

2 commits

Author SHA1 Message Date
a777e0ca8f Update layout 2024-07-29 18:06:28 +02:00
30dff576e7 Update style 2024-07-29 18:06:18 +02:00
3 changed files with 75 additions and 8 deletions

View file

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

View file

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

View file

@ -7,6 +7,7 @@ body {
margin: 0 auto;
}
/* Styles */
em {
padding-left: .1em;
padding-right: .1em;
@ -19,9 +20,7 @@ em {
background-color: #191f26;
}
/* Styles */
a.inline-code
{
a.inline-code {
padding-left: .1em;
padding-right: .1em;
@ -29,6 +28,73 @@ a.inline-code
background-color: #191f26;
}
/* Navbar */
#navbar {
left: 0;
top: 0;
bottom: 0;
width: max(16vw, 20ch);
overflow-y: auto;
position: absolute;
box-sizing: border-box;
overscroll-behavior-y: contain;
background-color: #161a26;
color: #aaa;
font-size: 0.9em;
font-weight: bold;
}
#navbar a {
color: #ffb454;
text-decoration: none;
font-weight: normal;
}
#navbar li {
display: block;
position: relative;
padding-left: 1em;
margin-left: 0em;
}
#navbar ul {
margin-left: 0em;
padding-left: 0;
}
#navbar summary{
display: block;
cursor: pointer;
}
#navbar summary::marker,
#navbar summary::-webkit-details-marker{
display: none;
}
#navbar summary:focus{
outline: none;
}
#navbar summary:focus-visible{
outline: 1px dotted #000;
}
#navbar summary:before {
content: "+";
color: #ffb454;
float: left;
text-align: center;
width: 1em;
}
#navbar details[open] > summary:before {
content: "";
}
/* Code blocks */
div.code-block-title {
background-color: #20202a;