Compare commits
2 commits
a68fa7cf48
...
c56a182d14
Author | SHA1 | Date | |
---|---|---|---|
c56a182d14 | |||
7ab62a0711 |
3 changed files with 37 additions and 11 deletions
10
src/error.rs
10
src/error.rs
|
@ -6,11 +6,11 @@ use thiserror::Error;
|
||||||
// fronma is too lazy to implement std::error::Error for their own types
|
// fronma is too lazy to implement std::error::Error for their own types
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
pub struct FronmaBalls(fronma::error::Error);
|
pub struct FronmaError(fronma::error::Error);
|
||||||
|
|
||||||
impl std::error::Error for FronmaBalls {}
|
impl std::error::Error for FronmaError {}
|
||||||
|
|
||||||
impl Display for FronmaBalls {
|
impl Display for FronmaError {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
f.write_str("failed to parse front matter: ")?;
|
f.write_str("failed to parse front matter: ")?;
|
||||||
match &self.0 {
|
match &self.0 {
|
||||||
|
@ -29,14 +29,14 @@ pub enum PostError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
AskamaError(#[from] askama::Error),
|
AskamaError(#[from] askama::Error),
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
ParseError(#[from] FronmaBalls),
|
ParseError(#[from] FronmaError),
|
||||||
#[error("post {0:?} not found")]
|
#[error("post {0:?} not found")]
|
||||||
NotFound(String),
|
NotFound(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<fronma::error::Error> for PostError {
|
impl From<fronma::error::Error> for PostError {
|
||||||
fn from(value: fronma::error::Error) -> Self {
|
fn from(value: fronma::error::Error) -> Self {
|
||||||
Self::ParseError(FronmaBalls(value))
|
Self::ParseError(FronmaError(value))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
.anchor {
|
.anchor {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
font-size: x-large;
|
||||||
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
.anchor::before {
|
.anchor::before {
|
||||||
content: "§";
|
content: "§";
|
||||||
|
@ -9,8 +11,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
font-size: larger;
|
padding: 0.15em 0.3em;
|
||||||
padding: 0.15em 0.4em;
|
overflow-wrap: break-word;
|
||||||
|
word-break: break-all;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
|
||||||
background-color: var(--surface0);
|
background-color: var(--surface0);
|
||||||
color: var(--subtext1);
|
color: var(--subtext1);
|
||||||
|
@ -21,8 +25,6 @@ pre > code {
|
||||||
border: 2px solid var(--surface0);
|
border: 2px solid var(--surface0);
|
||||||
padding: 1.25em 1.5em;
|
padding: 1.25em 1.5em;
|
||||||
display: block;
|
display: block;
|
||||||
overflow-wrap: break-word;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
|
|
||||||
background-color: var(--base);
|
background-color: var(--base);
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
|
@ -31,3 +33,24 @@ pre > code {
|
||||||
img {
|
img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table,
|
||||||
|
td,
|
||||||
|
th {
|
||||||
|
border: 1px solid var(--text);
|
||||||
|
border-collapse: collapse;
|
||||||
|
padding: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
th,
|
||||||
|
td:nth-child(1) {
|
||||||
|
word-break: keep-all;
|
||||||
|
}
|
||||||
|
|
|
@ -27,11 +27,14 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
:root {
|
:root,
|
||||||
|
code {
|
||||||
/* please have one at least one good monospace font */
|
/* please have one at least one good monospace font */
|
||||||
font-family: "Hack Nerd Font", "Hack", "JetBrains Mono",
|
font-family: "Hack", "Hack Nerd Font", "JetBrains Mono",
|
||||||
"JetBrainsMono Nerd Font", "Ubuntu Mono", monospace, sans-serif;
|
"JetBrainsMono Nerd Font", "Ubuntu Mono", monospace, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
:root {
|
||||||
background-color: var(--base);
|
background-color: var(--base);
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue