♻️ Cambia en prepare_component() el tipo devuelto

Elimina `PrepareMarkup` como tipo de retorno de prepare_component() y de
`FnPrepareRender`, sustituyéndolo directamente por `Markup`. Se elimina
una capa innecesaria, ya que html! {} y html! { ... } cubren todos los
casos que ofrecía `PrepareMarkup`.
This commit is contained in:
Manuel Cillero 2026-03-17 20:04:26 +01:00 committed by Manuel Cillero
parent 6203a02b89
commit 908fd969e4
28 changed files with 241 additions and 335 deletions

View file

@ -10,6 +10,7 @@ use crate::{builder_fn, util, CowStr};
use std::any::Any;
use std::collections::HashMap;
use std::fmt;
/// Operaciones para modificar recursos asociados al [`Context`] de un documento.
pub enum ContextOp {
@ -45,6 +46,26 @@ pub enum ContextError {
},
}
impl fmt::Display for ContextError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
ContextError::ParamNotFound => {
write!(f, "parameter not found")
}
ContextError::ParamTypeMismatch {
key,
expected,
saved,
} => write!(
f,
"type mismatch for parameter \"{key}\": expected \"{expected}\", found \"{saved}\""
),
}
}
}
impl std::error::Error for ContextError {}
/// Interfaz para gestionar el **contexto de renderizado** de un documento HTML.
///
/// `Contextual` extiende [`LangId`] para establecer el idioma del documento y añade métodos para: