Actualiza estructura de archivos a nueva edición
This commit is contained in:
parent
075c546fd5
commit
7d06cdec19
25 changed files with 35 additions and 30 deletions
|
|
@ -1,35 +1,10 @@
|
||||||
use crate::Lazy;
|
mod figfont;
|
||||||
|
use figfont::FIGFONT;
|
||||||
|
|
||||||
use crate::config::SETTINGS;
|
use crate::config::SETTINGS;
|
||||||
|
|
||||||
use figlet_rs::FIGfont;
|
|
||||||
use substring::Substring;
|
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() {
|
pub fn print_on_startup() {
|
||||||
if SETTINGS.app.startup_banner.to_lowercase() != "off" {
|
if SETTINGS.app.startup_banner.to_lowercase() != "off" {
|
||||||
if let Some((term_width, _)) = term_size::dimensions() {
|
if let Some((term_width, _)) = term_size::dimensions() {
|
||||||
30
pagetop/src/core/app/banner/figfont.rs
Normal file
30
pagetop/src/core/app/banner/figfont.rs
Normal 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()
|
||||||
|
});
|
||||||
|
|
@ -4,5 +4,5 @@ pub use hook::{
|
||||||
BeforeRenderPageHook,
|
BeforeRenderPageHook,
|
||||||
};
|
};
|
||||||
|
|
||||||
mod page;
|
mod definition;
|
||||||
pub use page::Page;
|
pub use definition::Page;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue