Actualiza estructura de archivos a nueva edición

This commit is contained in:
Manuel Cillero 2022-05-13 18:59:33 +02:00
parent 075c546fd5
commit 7d06cdec19
25 changed files with 35 additions and 30 deletions

View file

@ -1,35 +1,10 @@
use crate::Lazy;
mod figfont;
use figfont::FIGFONT;
use crate::config::SETTINGS;
use figlet_rs::FIGfont;
use substring::Substring;
static FIGFONT: Lazy<FIGfont> = Lazy::new(|| {
let slant = include_str!("slant.flf");
let small = include_str!("small.flf");
let speed = include_str!("speed.flf");
let starwars = include_str!("starwars.flf");
FIGfont::from_content(
match SETTINGS.app.startup_banner.to_lowercase().as_str() {
"off" => slant,
"slant" => slant,
"small" => small,
"speed" => speed,
"starwars" => starwars,
_ => {
println!(
"\n FIGfont \"{}\" not found for banner. {}. {}.",
SETTINGS.app.startup_banner,
"Using \"Slant\"",
"Check the settings file",
);
slant
}
}
).unwrap()
});
pub fn print_on_startup() {
if SETTINGS.app.startup_banner.to_lowercase() != "off" {
if let Some((term_width, _)) = term_size::dimensions() {

View file

@ -0,0 +1,30 @@
use crate::Lazy;
use crate::config::SETTINGS;
use figlet_rs::FIGfont;
pub static FIGFONT: Lazy<FIGfont> = Lazy::new(|| {
let slant = include_str!("slant.flf");
let small = include_str!("small.flf");
let speed = include_str!("speed.flf");
let starwars = include_str!("starwars.flf");
FIGfont::from_content(
match SETTINGS.app.startup_banner.to_lowercase().as_str() {
"off" => slant,
"slant" => slant,
"small" => small,
"speed" => speed,
"starwars" => starwars,
_ => {
println!(
"\n FIGfont \"{}\" not found for banner. {}. {}.",
SETTINGS.app.startup_banner,
"Using \"Slant\"",
"Check the settings file",
);
slant
}
}
).unwrap()
});

View file

@ -4,5 +4,5 @@ pub use hook::{
BeforeRenderPageHook,
};
mod page;
pub use page::Page;
mod definition;
pub use definition::Page;