// SPDX-FileCopyrightText: 2026 Slatian <baschdel@disroot.org>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
//! # Templates Manifest
//!
//! The templates manifest describe which text template formats are available besides the application hardcoded API formats.
//!
//! lib-humus uses [`HumusFormatIdentifier`][crate::templating::HumusFormatIdentifier] as human readable ids for the formats. A format identifier is an ASCII string up to 16 characters in length.
//!
//! The templates manifest is directly in the template directory called `templates.toml`.
//!
//! Direct keys:
//! * `default_format` - `HumusFormatIdentifier` A format to use as default when the client indicates no preference, this must be a valid API format or an entry in the `format` map.
//! * `format` - `Map<HumusFormatIdentifier, FormatDescription>` Contains descriptions for each template format.
//! * `media_type_aliases` - `Map<AcceptHeaderItem, HumusFormatIdentifier>` Maps whole or partial media types (same format as the HTTP `Accept` header) to the format that should be chosen when a client indicates a preference for that media type.
//! * `format_by_user_agent_prefix` - `Map<String, HumusFormatIdentifier>` Allows mapping prefixes of the `User-Agent` HTTP header to map to a default format when the client doen't communicate a matching preference.
//!
//! Minimum variable templates manifest:
//!
//! ```toml
//! default_format = "html"
//!
//! [format.html]
//! media_type = "text/html"
//! extension = "html"
//! ```
//!
//! ## Format description
//!
//! The format descriptions under `format` must contain the following keys:
//! * `media_type` - The media type to tell the client that the template output is
//! * `extension` - The file name extension of the template file (`{view-name}.{extension}`) it is recommended to keep this equal or related to the format identifier.
//!