📝 Retoques menores en la documentación
This commit is contained in:
parent
bf2c298d18
commit
8b06b1752a
3 changed files with 15 additions and 7 deletions
|
@ -9,9 +9,10 @@
|
|||
//! tipografías, espaciados y cualquier otro detalle visual o de comportamiento (como animaciones,
|
||||
//! *scripts* de interfaz, etc.).
|
||||
//!
|
||||
//! Es una extensión más (implementando [`Extension`](crate::core::extension::Extension)). Se
|
||||
//! instala, activa y declara dependencias igual que el resto de extensiones; y se señala a sí misma
|
||||
//! como tema (implementando [`theme()`](crate::core::extension::Extension::theme) y [`Theme`]).
|
||||
//! Los temas son extensiones que implementan [`Extension`](crate::core::extension::Extension); por
|
||||
//! lo que se instancian, declaran sus dependencias y se inician igual que el resto de extensiones;
|
||||
//! pero serán temas si además implementan [`theme()`](crate::core::extension::Extension::theme) y
|
||||
//! [`Theme`].
|
||||
|
||||
mod definition;
|
||||
pub use definition::{Theme, ThemeRef};
|
||||
|
|
|
@ -14,7 +14,7 @@ pub type ThemeRef = &'static dyn Theme;
|
|||
/// Interfaz común que debe implementar cualquier tema de `PageTop`.
|
||||
///
|
||||
/// Un tema implementará [`Theme`] y los métodos que sean necesarios de [`Extension`], aunque el
|
||||
/// único obligatorio es [`theme()`](Extension::theme).
|
||||
/// único obligatorio será [`theme()`](Extension::theme).
|
||||
///
|
||||
/// ```rust
|
||||
/// use pagetop::prelude::*;
|
||||
|
@ -22,8 +22,13 @@ pub type ThemeRef = &'static dyn Theme;
|
|||
/// pub struct MyTheme;
|
||||
///
|
||||
/// impl Extension for MyTheme {
|
||||
/// fn name(&self) -> L10n { L10n::n("My theme") }
|
||||
/// fn description(&self) -> L10n { L10n::n("Un tema personal") }
|
||||
/// fn name(&self) -> L10n {
|
||||
/// L10n::n("My theme")
|
||||
/// }
|
||||
///
|
||||
/// fn description(&self) -> L10n {
|
||||
/// L10n::n("A personal theme")
|
||||
/// }
|
||||
///
|
||||
/// fn theme(&self) -> Option<ThemeRef> {
|
||||
/// Some(&Self)
|
||||
|
|
|
@ -56,8 +56,10 @@ pub fn resolve_absolute_dir<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
|
|||
}
|
||||
}
|
||||
|
||||
/// **Obsoleto desde la versión 0.3.0**: usar [`resolve_absolute_dir()`] en su lugar.
|
||||
///
|
||||
/// Devuelve la ruta absoluta a un directorio existente.
|
||||
#[deprecated(since = "0.3.0", note = "Use [`resolve_absolute_dir`] instead")]
|
||||
#[deprecated(since = "0.3.0", note = "Use `resolve_absolute_dir()` instead")]
|
||||
pub fn absolute_dir<P, Q>(root_path: P, relative_path: Q) -> io::Result<PathBuf>
|
||||
where
|
||||
P: AsRef<Path>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue