lib/render/defaults.rs
1//! Defines defaults for working with templates.
2
3/// The opening tag for defining a config block in a template.
4///
5/// A template's config must be placed at the top of the file and placed inside an HTML-flavored
6/// comment tag.
7///
8/// ```html
9/// <!-- readstor
10/// ...
11/// -->
12/// ```
13pub const CONFIG_TAG_OPEN: &str = "<!-- readstor\n";
14
15/// The closing tag for defining a config block in a template. See [`CONFIG_TAG_OPEN`] for more
16/// information.
17pub const CONFIG_TAG_CLOSE: &str = "\n-->\n";
18
19/// The default template used to generate the output filename for a template with
20/// [`ContextMode::Book`][book].
21///
22/// [book]: super::template::ContextMode::Book
23pub const FILENAME_TEMPLATE_BOOK: &str = "{{ book.author }} - {{ book.title }}";
24
25/// The default template used to generate the output filename for a template with
26/// [`ContextMode::Annotation`][annotation].
27///
28/// [annotation]: super::template::ContextMode::Annotation
29pub const FILENAME_TEMPLATE_ANNOTATION: &str =
30 "{{ annotation.slugs.metadata.created }}-{{ book.slugs.title }}";
31
32/// The default template used to generate the directory name for a template with
33/// [`StructureMode::Nested`][nested] or [`StructureMode::NestedGrouped`][nested-grouped].
34///
35///
36/// [nested]: super::template::StructureMode::Nested
37/// [nested-grouped]: super::template::StructureMode::NestedGrouped
38pub const DIRECTORY_TEMPLATE: &str = "{{ book.author }} - {{ book.title }}";