Rust library to generate static websites
1use maudit::content::{MarkdownComponents, MarkdownOptions, glob_markdown_with_options};
2use maudit::{BuildOptions, BuildOutput, content_sources, coronate, routes};
3
4mod components;
5mod routes;
6
7use components::*;
8use routes::{ComponentExample, IndexPage};
9
10fn main() -> Result<BuildOutput, Box<dyn std::error::Error>> {
11 coronate(
12 routes![IndexPage],
13 content_sources![
14 "examples" => glob_markdown_with_options::<ComponentExample>("content/*.md",
15 MarkdownOptions::with_components(
16 MarkdownComponents::new()
17 .heading(CustomHeading)
18 .paragraph(CustomParagraph)
19 .link(CustomLink)
20 .image(CustomImage)
21 .strong(CustomStrong)
22 .emphasis(CustomEmphasis)
23 .code(CustomCode)
24 .blockquote(CustomBlockquote)
25 .hard_break(CustomHardBreak)
26 .horizontal_rule(CustomHorizontalRule)
27 .list(CustomList)
28 .list_item(CustomListItem)
29 .strikethrough(CustomStrikethrough)
30 .task_list_marker(CustomTaskListMarker)
31 .table(CustomTable)
32 .table_head(CustomTableHead)
33 .table_row(CustomTableRow)
34 .table_cell(CustomTableCell), Default::default()
35 ))
36 ],
37 BuildOptions::default(),
38 )
39}