1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Explicit returning can improve readability
// Better than uing an Option …
// Don't want to deal with reimplmenting as `Display` right now.
// Those are okay
// Tabs are just fine
// SPDX-FileCopyrightText: 2026 Slatian <baschdel@disroot.org>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
//! lib-humus helps with some fertile ground to build a web project on.
//!
//! # What is lib-humus?
//!
//! lib-humus is an opinioated, pre-assembled templating engine that takes care of the frontend for a web application that builds on top of the [axum] framework.
//!
//! Its main use is in your handler functions right at the end to turn data from your application into the response that the client wants, be it HTML, plain text, json or something else.
//!
//! It allows you to focus on the data and the templates without having to worry about template engine details.
//!
//! Under the hood it uses well known crates like [tera] for templates and [fluent] for localization.
//!
//! # lib-humus is a family
//!
//! * [lib_humus_configuration] - filepath in, parsed data or a good error out, for json, json5 and toml files.
//!
//! # Overview
//!
//! The original idea behind this is that all the data that gets rendered as html
//! should also be available as a JSON-API (and other formats if useful).
//! The HTML should also come from easily replaceable templates
//! that are themselves configurable.
//!
//! The [HumusEngine] helps you with that,
//! it generated an appropriate response given a [HumusView] and [HumusQuerySettings].
//!
//! The [HumusView] providing the data and metadata for the frontend in the form of being serde serializable and through a number of callbacks and hooks.
//!
//! The [HumusQuerySettings] instance provides information on how to render the result.
//!
//! Loading the templates and the template configuration
//! can be done using the [HumusEngineLoader].
//!
//! The [HumusQuerySettings] can be obtanied by adding a [TemplateSettingsLayer][middleware::TemplateSettingsLayer] as an axum middleware.
//!
//! The [LanguageEngine][crate::language::LanguageEngine] is provided to both the templates [and your code][HumusEngine::language_engine] to generate localized responses.
//!
//! This library is derived from (and now used by) the
//! [echoip-slatecave service](https://codeberg.org/slatian/service.echoip-slatecave).
//!
//! For more documentation see the [doc module][doc].
//!
//! # Feature-flags
//!
//! Feature flags have been removed in version `0.6`.
///////////////////////////////////////
// Tera-Loader
pub use *;
///////////////////////////////////////
// Axum-View
pub use ;
///////////////////////////////////////
// Language Engine
///////////////////////////////////////
// Middleware
///////////////////////////////////////
// HTTP Headers
///////////////////////////////////////
// Helper modules