🎨 Mejora la página de bienvenida y el tema básico #6
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,
|
//! tipografías, espaciados y cualquier otro detalle visual o de comportamiento (como animaciones,
|
||||||
//! *scripts* de interfaz, etc.).
|
//! *scripts* de interfaz, etc.).
|
||||||
//!
|
//!
|
||||||
//! Es una extensión más (implementando [`Extension`](crate::core::extension::Extension)). Se
|
//! Los temas son extensiones que implementan [`Extension`](crate::core::extension::Extension); por
|
||||||
//! instala, activa y declara dependencias igual que el resto de extensiones; y se señala a sí misma
|
//! lo que se instancian, declaran sus dependencias y se inician igual que el resto de extensiones;
|
||||||
//! como tema (implementando [`theme()`](crate::core::extension::Extension::theme) y [`Theme`]).
|
//! pero serán temas si además implementan [`theme()`](crate::core::extension::Extension::theme) y
|
||||||
|
//! [`Theme`].
|
||||||
|
|
||||||
mod definition;
|
mod definition;
|
||||||
pub use definition::{Theme, ThemeRef};
|
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`.
|
/// 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
|
/// 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
|
/// ```rust
|
||||||
/// use pagetop::prelude::*;
|
/// use pagetop::prelude::*;
|
||||||
|
@ -22,8 +22,13 @@ pub type ThemeRef = &'static dyn Theme;
|
||||||
/// pub struct MyTheme;
|
/// pub struct MyTheme;
|
||||||
///
|
///
|
||||||
/// impl Extension for MyTheme {
|
/// impl Extension for MyTheme {
|
||||||
/// fn name(&self) -> L10n { L10n::n("My theme") }
|
/// fn name(&self) -> L10n {
|
||||||
/// fn description(&self) -> L10n { L10n::n("Un tema personal") }
|
/// L10n::n("My theme")
|
||||||
|
/// }
|
||||||
|
///
|
||||||
|
/// fn description(&self) -> L10n {
|
||||||
|
/// L10n::n("A personal theme")
|
||||||
|
/// }
|
||||||
///
|
///
|
||||||
/// fn theme(&self) -> Option<ThemeRef> {
|
/// fn theme(&self) -> Option<ThemeRef> {
|
||||||
/// Some(&Self)
|
/// 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.
|
/// 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>
|
pub fn absolute_dir<P, Q>(root_path: P, relative_path: Q) -> io::Result<PathBuf>
|
||||||
where
|
where
|
||||||
P: AsRef<Path>,
|
P: AsRef<Path>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue