feat: declare a Mews page's feed, keep its prolog, and lift link-only list items
This commit is contained in:
parent
3e659df9dd
commit
c08b03db7b
9 changed files with 223 additions and 116 deletions
|
|
@ -58,8 +58,7 @@ mod tests {
|
|||
/// assertions read as the content itself.
|
||||
fn render_with(settings: &PageSettings, width: u16, markdown: &str) -> String {
|
||||
let doc = parse::markdown(markdown).unwrap();
|
||||
let ctx =
|
||||
RenderCtx { url: "/x", title: "T", settings, width: Some(width), mews_hosts: None };
|
||||
let ctx = RenderCtx { url: "/x", title: "T", settings, width: Some(width), mews: None };
|
||||
String::from_utf8(Text.render(&doc, &ctx).unwrap().body).unwrap()
|
||||
}
|
||||
|
||||
|
|
@ -214,8 +213,7 @@ mod tests {
|
|||
/// `parse::document`, which needs a file, so the unit tests build them.
|
||||
fn render_blocks(settings: &PageSettings, width: u16, blocks: Vec<Block>) -> String {
|
||||
let doc = Doc { blocks, first_h1: None };
|
||||
let ctx =
|
||||
RenderCtx { url: "/x", title: "T", settings, width: Some(width), mews_hosts: None };
|
||||
let ctx = RenderCtx { url: "/x", title: "T", settings, width: Some(width), mews: None };
|
||||
String::from_utf8(Text.render(&doc, &ctx).unwrap().body).unwrap()
|
||||
}
|
||||
|
||||
|
|
@ -269,13 +267,8 @@ mod separation_tests {
|
|||
fn render(markdown: &str) -> String {
|
||||
let doc = parse::markdown(markdown).unwrap();
|
||||
let settings = PageSettings { margin_left: 0, margin_right: 0, ..Default::default() };
|
||||
let ctx = RenderCtx {
|
||||
url: "/x",
|
||||
title: "T",
|
||||
settings: &settings,
|
||||
width: Some(40),
|
||||
mews_hosts: None,
|
||||
};
|
||||
let ctx =
|
||||
RenderCtx { url: "/x", title: "T", settings: &settings, width: Some(40), mews: None };
|
||||
String::from_utf8(Text.render(&doc, &ctx).unwrap().body).unwrap()
|
||||
}
|
||||
|
||||
|
|
@ -307,8 +300,7 @@ mod optional_feature_tests {
|
|||
|
||||
fn render_with(settings: &PageSettings, width: u16, markdown: &str) -> String {
|
||||
let doc = parse::markdown(markdown).unwrap();
|
||||
let ctx =
|
||||
RenderCtx { url: "/x", title: "T", settings, width: Some(width), mews_hosts: None };
|
||||
let ctx = RenderCtx { url: "/x", title: "T", settings, width: Some(width), mews: None };
|
||||
String::from_utf8(Text.render(&doc, &ctx).unwrap().body).unwrap()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue