diff --git a/.gitignore b/.gitignore index 855694f..56ee30e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ # Ignora directorios de compilación **/target + +# Archivos de configuración locales +**/local.*.toml +**/local.toml +.env diff --git a/Cargo.lock b/Cargo.lock index 0528b57..045a72f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -319,6 +319,27 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" +[[package]] +name = "colored" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fde0e0ec90c9dfb3b4b1a0891a7dcd0e2bffde2f7efed5fe7c9bb00e5bfb915e" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "config" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595aae20e65c3be792d05818e8c63025294ac3cb7e200f11459063a352a6ef80" +dependencies = [ + "pathdiff", + "serde", + "toml", + "winnow", +] + [[package]] name = "cookie" version = "0.16.2" @@ -424,6 +445,22 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +[[package]] +name = "errno" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "figlet-rs" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4742a071cd9694fc86f9fa1a08fa3e53d40cc899d7ee532295da2d085639fbc5" + [[package]] name = "flate2" version = "1.1.2" @@ -712,6 +749,12 @@ version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + [[package]] name = "litemap" version = "0.8.0" @@ -807,10 +850,16 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "pagetop" -version = "0.0.1" +version = "0.0.2" dependencies = [ "actix-web", + "colored", + "config", + "figlet-rs", "pagetop-macros", + "serde", + "substring", + "terminal_size", ] [[package]] @@ -843,6 +892,12 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "pathdiff" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" + [[package]] name = "percent-encoding" version = "2.3.1" @@ -994,6 +1049,19 @@ version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + [[package]] name = "ryu" version = "1.0.20" @@ -1038,6 +1106,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -1104,6 +1181,15 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "substring" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86" +dependencies = [ + "autocfg", +] + [[package]] name = "syn" version = "2.0.104" @@ -1126,6 +1212,16 @@ dependencies = [ "syn", ] +[[package]] +name = "terminal_size" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" +dependencies = [ + "rustix", + "windows-sys 0.59.0", +] + [[package]] name = "time" version = "0.3.41" @@ -1197,6 +1293,40 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + [[package]] name = "tracing" version = "0.1.41" @@ -1367,6 +1497,15 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" +dependencies = [ + "memchr", +] + [[package]] name = "wit-bindgen-rt" version = "0.39.0" diff --git a/Cargo.toml b/Cargo.toml index 33bb5bf..a844f52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pagetop" -version = "0.0.1" +version = "0.0.2" edition = "2021" description = """\ @@ -15,6 +15,13 @@ license.workspace = true authors.workspace = true [dependencies] +colored = "3.0.0" +config = { version = "0.15.11", default-features = false, features = ["toml"] } +figlet-rs = "0.1.5" +serde.workspace = true +substring = "1.4.5" +terminal_size = "0.4.2" + actix-web = "4.11.0" pagetop-macros.workspace = true @@ -34,5 +41,7 @@ license = "MIT OR Apache-2.0" authors = ["Manuel Cillero "] [workspace.dependencies] +serde = { version = "1.0", features = ["derive"] } + # Helpers pagetop-macros = { version = "0.0", path = "helpers/pagetop-macros" } diff --git a/src/app.rs b/src/app.rs index 711c763..bac7482 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,6 +1,10 @@ //! Prepara y ejecuta una aplicación creada con `Pagetop`. -use crate::service; +mod figfont; + +use crate::{global, service}; + +use substring::Substring; use std::io::Error; @@ -9,14 +13,61 @@ pub struct Application; impl Application { /// Crea una instancia de la aplicación. pub fn new() -> Self { + // Al arrancar muestra una cabecera para la aplicación. + Self::show_banner(); Self } + // Muestra una cabecera para la aplicación basada en la configuración. + fn show_banner() { + use colored::Colorize; + use terminal_size::{terminal_size, Width}; + + if global::SETTINGS.app.startup_banner.to_lowercase() != "off" { + // Nombre de la aplicación, ajustado al ancho del terminal si es necesario. + let mut app_ff = String::new(); + let app_name = &global::SETTINGS.app.name; + if let Some((Width(term_width), _)) = terminal_size() { + if term_width >= 80 { + let maxlen: usize = ((term_width / 10) - 2).into(); + let mut app = app_name.substring(0, maxlen).to_owned(); + if app_name.len() > maxlen { + app = format!("{app}..."); + } + if let Some(ff) = figfont::FIGFONT.convert(&app) { + app_ff = ff.to_string(); + } + } + } + if app_ff.is_empty() { + println!("\n{app_name}"); + } else { + print!("\n{app_ff}"); + } + + // Descripción de la aplicación. + if !global::SETTINGS.app.description.is_empty() { + println!("{}", global::SETTINGS.app.description.cyan()); + }; + + // Versión de PageTop. + println!( + "{} {}\n", + "Powered by PageTop".yellow(), + env!("CARGO_PKG_VERSION").yellow() + ); + } + } + /// Ejecuta el servidor web de la aplicación. pub fn run(self) -> Result { // Prepara el servidor web. Ok(service::HttpServer::new(move || Self::service_app()) - .bind("localhost:8080")? + .bind(format!( + "{}:{}", + &global::SETTINGS.server.bind_address, + &global::SETTINGS.server.bind_port + ))? .run()) } diff --git a/src/app/figfont.rs b/src/app/figfont.rs new file mode 100644 index 0000000..6592d81 --- /dev/null +++ b/src/app/figfont.rs @@ -0,0 +1,30 @@ +use crate::global; + +use std::sync::LazyLock; + +use figlet_rs::FIGfont; + +pub static FIGFONT: LazyLock = LazyLock::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 global::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. Using \"Slant\". Check settings.", + global::SETTINGS.app.startup_banner, + ); + slant + } + }, + ) + .unwrap() +}); diff --git a/src/app/slant.flf b/src/app/slant.flf new file mode 100644 index 0000000..ea27b6e --- /dev/null +++ b/src/app/slant.flf @@ -0,0 +1,1295 @@ +flf2a$ 6 5 16 15 10 0 18319 +Slant by Glenn Chappell 3/93 -- based on Standard +Includes ISO Latin-1 +figlet release 2.1 -- 12 Aug 1994 +Permission is hereby given to modify this font, as long as the +modifier's name is placed on a comment line. + +Modified by Paul Burton 12/96 to include new parameter +supported by FIGlet and FIGWin. May also be slightly modified for better use +of new full-width/kern/smush alternatives, but default output is NOT changed. + + $$@ + $$ @ + $$ @ + $$ @ + $$ @ +$$ @@ + __@ + / /@ + / / @ + /_/ @ +(_) @ + @@ + _ _ @ +( | )@ +|/|/ @ + $ @ +$ @ + @@ + __ __ @ + __/ // /_@ + /_ _ __/@ +/_ _ __/ @ + /_//_/ @ + @@ + __@ + _/ /@ + / __/@ + (_ ) @ +/ _/ @ +/_/ @@ + _ __@ + (_)_/_/@ + _/_/ @ + _/_/_ @ +/_/ (_) @ + @@ + ___ @ + ( _ ) @ + / __ \/|@ +/ /_/ < @ +\____/\/ @ + @@ + _ @ + ( )@ + |/ @ + $ @ +$ @ + @@ + __@ + _/_/@ + / / @ + / / @ +/ / @ +|_| @@ + _ @ + | |@ + / /@ + / / @ + _/_/ @ +/_/ @@ + @ + __/|_@ + | /@ +/_ __| @ + |/ @ + @@ + @ + __ @ + __/ /_@ +/_ __/@ + /_/ @ + @@ + @ + @ + @ + _ @ +( )@ +|/ @@ + @ + @ + ______@ +/_____/@ + $ @ + @@ + @ + @ + @ + _ @ +(_)@ + @@ + __@ + _/_/@ + _/_/ @ + _/_/ @ +/_/ @ + @@ + ____ @ + / __ \@ + / / / /@ +/ /_/ / @ +\____/ @ + @@ + ___@ + < /@ + / / @ + / / @ +/_/ @ + @@ + ___ @ + |__ \@ + __/ /@ + / __/ @ +/____/ @ + @@ + _____@ + |__ /@ + /_ < @ + ___/ / @ +/____/ @ + @@ + __ __@ + / // /@ + / // /_@ +/__ __/@ + /_/ @ + @@ + ______@ + / ____/@ + /___ \ @ + ____/ / @ +/_____/ @ + @@ + _____@ + / ___/@ + / __ \ @ +/ /_/ / @ +\____/ @ + @@ + _____@ +/__ /@ + / / @ + / / @ +/_/ @ + @@ + ____ @ + ( __ )@ + / __ |@ +/ /_/ / @ +\____/ @ + @@ + ____ @ + / __ \@ + / /_/ /@ + \__, / @ +/____/ @ + @@ + @ + _ @ + (_)@ + _ @ +(_) @ + @@ + @ + _ @ + (_)@ + _ @ +( ) @ +|/ @@ + __@ + / /@ +/ / @ +\ \ @ + \_\@ + @@ + @ + _____@ + /____/@ +/____/ @ + $ @ + @@ +__ @ +\ \ @ + \ \@ + / /@ +/_/ @ + @@ + ___ @ + /__ \@ + / _/@ + /_/ @ +(_) @ + @@ + ______ @ + / ____ \@ + / / __ `/@ +/ / /_/ / @ +\ \__,_/ @ + \____/ @@ + ___ @ + / |@ + / /| |@ + / ___ |@ +/_/ |_|@ + @@ + ____ @ + / __ )@ + / __ |@ + / /_/ / @ +/_____/ @ + @@ + ______@ + / ____/@ + / / @ +/ /___ @ +\____/ @ + @@ + ____ @ + / __ \@ + / / / /@ + / /_/ / @ +/_____/ @ + @@ + ______@ + / ____/@ + / __/ @ + / /___ @ +/_____/ @ + @@ + ______@ + / ____/@ + / /_ @ + / __/ @ +/_/ @ + @@ + ______@ + / ____/@ + / / __ @ +/ /_/ / @ +\____/ @ + @@ + __ __@ + / / / /@ + / /_/ / @ + / __ / @ +/_/ /_/ @ + @@ + ____@ + / _/@ + / / @ + _/ / @ +/___/ @ + @@ + __@ + / /@ + __ / / @ +/ /_/ / @ +\____/ @ + @@ + __ __@ + / //_/@ + / ,< @ + / /| | @ +/_/ |_| @ + @@ + __ @ + / / @ + / / @ + / /___@ +/_____/@ + @@ + __ ___@ + / |/ /@ + / /|_/ / @ + / / / / @ +/_/ /_/ @ + @@ + _ __@ + / | / /@ + / |/ / @ + / /| / @ +/_/ |_/ @ + @@ + ____ @ + / __ \@ + / / / /@ +/ /_/ / @ +\____/ @ + @@ + ____ @ + / __ \@ + / /_/ /@ + / ____/ @ +/_/ @ + @@ + ____ @ + / __ \@ + / / / /@ +/ /_/ / @ +\___\_\ @ + @@ + ____ @ + / __ \@ + / /_/ /@ + / _, _/ @ +/_/ |_| @ + @@ + _____@ + / ___/@ + \__ \ @ + ___/ / @ +/____/ @ + @@ + ______@ + /_ __/@ + / / @ + / / @ +/_/ @ + @@ + __ __@ + / / / /@ + / / / / @ +/ /_/ / @ +\____/ @ + @@ + _ __@ +| | / /@ +| | / / @ +| |/ / @ +|___/ @ + @@ + _ __@ +| | / /@ +| | /| / / @ +| |/ |/ / @ +|__/|__/ @ + @@ + _ __@ + | |/ /@ + | / @ + / | @ +/_/|_| @ + @@ +__ __@ +\ \/ /@ + \ / @ + / / @ +/_/ @ + @@ + _____@ +/__ /@ + / / @ + / /__@ +/____/@ + @@ + ___@ + / _/@ + / / @ + / / @ + / / @ +/__/ @@ +__ @ +\ \ @ + \ \ @ + \ \ @ + \_\@ + @@ + ___@ + / /@ + / / @ + / / @ + _/ / @ +/__/ @@ + //|@ + |/||@ + $ @ + $ @ +$ @ + @@ + @ + @ + @ + @ + ______@ +/_____/@@ + _ @ + ( )@ + V @ + $ @ +$ @ + @@ + @ + ____ _@ + / __ `/@ +/ /_/ / @ +\__,_/ @ + @@ + __ @ + / /_ @ + / __ \@ + / /_/ /@ +/_.___/ @ + @@ + @ + _____@ + / ___/@ +/ /__ @ +\___/ @ + @@ + __@ + ____/ /@ + / __ / @ +/ /_/ / @ +\__,_/ @ + @@ + @ + ___ @ + / _ \@ +/ __/@ +\___/ @ + @@ + ____@ + / __/@ + / /_ @ + / __/ @ +/_/ @ + @@ + @ + ____ _@ + / __ `/@ + / /_/ / @ + \__, / @ +/____/ @@ + __ @ + / /_ @ + / __ \@ + / / / /@ +/_/ /_/ @ + @@ + _ @ + (_)@ + / / @ + / / @ +/_/ @ + @@ + _ @ + (_)@ + / / @ + / / @ + __/ / @ +/___/ @@ + __ @ + / /__@ + / //_/@ + / ,< @ +/_/|_| @ + @@ + __@ + / /@ + / / @ + / / @ +/_/ @ + @@ + @ + ____ ___ @ + / __ `__ \@ + / / / / / /@ +/_/ /_/ /_/ @ + @@ + @ + ____ @ + / __ \@ + / / / /@ +/_/ /_/ @ + @@ + @ + ____ @ + / __ \@ +/ /_/ /@ +\____/ @ + @@ + @ + ____ @ + / __ \@ + / /_/ /@ + / .___/ @ +/_/ @@ + @ + ____ _@ + / __ `/@ +/ /_/ / @ +\__, / @ + /_/ @@ + @ + _____@ + / ___/@ + / / @ +/_/ @ + @@ + @ + _____@ + / ___/@ + (__ ) @ +/____/ @ + @@ + __ @ + / /_@ + / __/@ +/ /_ @ +\__/ @ + @@ + @ + __ __@ + / / / /@ +/ /_/ / @ +\__,_/ @ + @@ + @ + _ __@ +| | / /@ +| |/ / @ +|___/ @ + @@ + @ + _ __@ +| | /| / /@ +| |/ |/ / @ +|__/|__/ @ + @@ + @ + _ __@ + | |/_/@ + _> < @ +/_/|_| @ + @@ + @ + __ __@ + / / / /@ + / /_/ / @ + \__, / @ +/____/ @@ + @ + ____@ +/_ /@ + / /_@ +/___/@ + @@ + __@ + _/_/@ + _/_/ @ +< < @ +/ / @ +\_\ @@ + __@ + / /@ + / / @ + / / @ + / / @ +/_/ @@ + _ @ + | |@ + / /@ + _>_>@ + _/_/ @ +/_/ @@ + /\//@ + //\/ @ + $ @ + $ @ +$ @ + @@ + _ _ @ + (_)(_)@ + / _ | @ + / __ | @ +/_/ |_| @ + @@ + _ _ @ + (_)_(_)@ + / __ \ @ +/ /_/ / @ +\____/ @ + @@ + _ _ @ + (_) (_)@ + / / / / @ +/ /_/ / @ +\____/ @ + @@ + _ _ @ + (_)_(_)@ + / __ `/ @ +/ /_/ / @ +\__,_/ @ + @@ + _ _ @ + (_)_(_)@ + / __ \ @ +/ /_/ / @ +\____/ @ + @@ + _ _ @ + (_) (_)@ + / / / / @ +/ /_/ / @ +\__,_/ @ + @@ + ____ @ + / __ \@ + / / / /@ + / /_| | @ + / //__/ @ +/_/ @@ +160 NO-BREAK SPACE + $$@ + $$ @ + $$ @ + $$ @ + $$ @ +$$ @@ +161 INVERTED EXCLAMATION MARK + _ @ + (_)@ + / / @ + / / @ +/_/ @ + @@ +162 CENT SIGN + __@ + __/ /@ + / ___/@ +/ /__ @ +\ _/ @ +/_/ @@ +163 POUND SIGN + ____ @ + / ,__\@ + __/ /_ @ + _/ /___ @ +(_,____/ @ + @@ +164 CURRENCY SIGN + /|___/|@ + | __ / @ + / /_/ / @ + /___ | @ +|/ |/ @ + @@ +165 YEN SIGN + ____@ + _| / /@ + /_ __/@ +/_ __/ @ + /_/ @ + @@ +166 BROKEN BAR + __@ + / /@ + /_/ @ + __ @ + / / @ +/_/ @@ +167 SECTION SIGN + __ @ + _/ _)@ + / | | @ + | || | @ + | |_/ @ +(__/ @@ +168 DIAERESIS + _ _ @ + (_) (_)@ + $ $ @ + $ $ @ +$ $ @ + @@ +169 COPYRIGHT SIGN + ______ @ + / _____\ @ + / / ___/ |@ + / / /__ / @ +| \___/ / @ + \______/ @@ +170 FEMININE ORDINAL INDICATOR + ___ _@ + / _ `/@ + _\_,_/ @ +/____/ @ + $ @ + @@ +171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + ____@ + / / /@ +/ / / @ +\ \ \ @ + \_\_\@ + @@ +172 NOT SIGN + @ + ______@ +/___ /@ + /_/ @ + $ @ + @@ +173 SOFT HYPHEN + @ + @ + _____@ +/____/@ + $ @ + @@ +174 REGISTERED SIGN + ______ @ + / ___ \ @ + / / _ \ |@ + / / , _/ / @ +| /_/|_| / @ + \______/ @@ +175 MACRON + ______@ +/_____/@ + $ @ + $ @ +$ @ + @@ +176 DEGREE SIGN + ___ @ + / _ \@ +/ // /@ +\___/ @ + $ @ + @@ +177 PLUS-MINUS SIGN + __ @ + __/ /_@ + /_ __/@ + __/_/_ @ +/_____/ @ + @@ +178 SUPERSCRIPT TWO + ___ @ + |_ |@ + / __/ @ +/____/ @ + $ @ + @@ +179 SUPERSCRIPT THREE + ____@ + |_ /@ + _/_ < @ +/____/ @ + $ @ + @@ +180 ACUTE ACCENT + __@ + /_/@ + $ @ + $ @ +$ @ + @@ +181 MICRO SIGN + @ + __ __@ + / / / /@ + / /_/ / @ + / ._,_/ @ +/_/ @@ +182 PILCROW SIGN + _______@ + / _ /@ +/ (/ / / @ +\_ / / @ + /_/_/ @ + @@ +183 MIDDLE DOT + @ + _ @ +(_)@ + $ @ +$ @ + @@ +184 CEDILLA + @ + @ + @ + @ + _ @ +/_)@@ +185 SUPERSCRIPT ONE + ___@ + < /@ + / / @ +/_/ @ +$ @ + @@ +186 MASCULINE ORDINAL INDICATOR + ___ @ + / _ \@ + _\___/@ +/____/ @ + $ @ + @@ +187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +____ @ +\ \ \ @ + \ \ \@ + / / /@ +/_/_/ @ + @@ +188 VULGAR FRACTION ONE QUARTER + ___ __ @ + < / _/_/ @ + / /_/_/___@ +/_//_// / /@ + /_/ /_ _/@ + /_/ @@ +189 VULGAR FRACTION ONE HALF + ___ __ @ + < / _/_/__ @ + / /_/_/|_ |@ +/_//_/ / __/ @ + /_/ /____/ @ + @@ +190 VULGAR FRACTION THREE QUARTERS + ____ __ @ + |_ / _/_/ @ + _/_ < _/_/___@ +/____//_// / /@ + /_/ /_ _/@ + /_/ @@ +191 INVERTED QUESTION MARK + _ @ + (_)@ + _/ / @ +/ _/_ @ +\___/ @ + @@ +192 LATIN CAPITAL LETTER A WITH GRAVE + __ @ + _\_\@ + / _ |@ + / __ |@ +/_/ |_|@ + @@ +193 LATIN CAPITAL LETTER A WITH ACUTE + __@ + _/_/@ + / _ |@ + / __ |@ +/_/ |_|@ + @@ +194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX + //|@ + _|/||@ + / _ | @ + / __ | @ +/_/ |_| @ + @@ +195 LATIN CAPITAL LETTER A WITH TILDE + /\//@ + _//\/ @ + / _ | @ + / __ | @ +/_/ |_| @ + @@ +196 LATIN CAPITAL LETTER A WITH DIAERESIS + _ _ @ + (_)(_)@ + / _ | @ + / __ | @ +/_/ |_| @ + @@ +197 LATIN CAPITAL LETTER A WITH RING ABOVE + (())@ + / |@ + / /| |@ + / ___ |@ +/_/ |_|@ + @@ +198 LATIN CAPITAL LETTER AE + __________@ + / ____/@ + / /| __/ @ + / __ /___ @ +/_/ /_____/ @ + @@ +199 LATIN CAPITAL LETTER C WITH CEDILLA + ______@ + / ____/@ + / / @ +/ /___ @ +\____/ @ + /_) @@ +200 LATIN CAPITAL LETTER E WITH GRAVE + __ @ + _\_\@ + / __/@ + / _/ @ +/___/ @ + @@ +201 LATIN CAPITAL LETTER E WITH ACUTE + __@ + _/_/@ + / __/@ + / _/ @ +/___/ @ + @@ +202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX + //|@ + _|/||@ + / __/ @ + / _/ @ +/___/ @ + @@ +203 LATIN CAPITAL LETTER E WITH DIAERESIS + _ _ @ + (_)(_)@ + / __/ @ + / _/ @ +/___/ @ + @@ +204 LATIN CAPITAL LETTER I WITH GRAVE + __ @ + _\_\@ + / _/@ + _/ / @ +/___/ @ + @@ +205 LATIN CAPITAL LETTER I WITH ACUTE + __@ + _/_/@ + / _/@ + _/ / @ +/___/ @ + @@ +206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX + //|@ + _|/||@ + / _/ @ + _/ / @ +/___/ @ + @@ +207 LATIN CAPITAL LETTER I WITH DIAERESIS + _ _ @ + (_)(_)@ + / _/ @ + _/ / @ +/___/ @ + @@ +208 LATIN CAPITAL LETTER ETH + ____ @ + / __ \@ + __/ /_/ /@ +/_ __/ / @ + /_____/ @ + @@ +209 LATIN CAPITAL LETTER N WITH TILDE + /\//@ + _//\/ @ + / |/ / @ + / / @ +/_/|_/ @ + @@ +210 LATIN CAPITAL LETTER O WITH GRAVE + __ @ + __\_\@ + / __ \@ +/ /_/ /@ +\____/ @ + @@ +211 LATIN CAPITAL LETTER O WITH ACUTE + __@ + __/_/@ + / __ \@ +/ /_/ /@ +\____/ @ + @@ +212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX + //|@ + _|/||@ + / __ \@ +/ /_/ /@ +\____/ @ + @@ +213 LATIN CAPITAL LETTER O WITH TILDE + /\//@ + _//\/ @ + / __ \ @ +/ /_/ / @ +\____/ @ + @@ +214 LATIN CAPITAL LETTER O WITH DIAERESIS + _ _ @ + (_)_(_)@ + / __ \ @ +/ /_/ / @ +\____/ @ + @@ +215 MULTIPLICATION SIGN + @ + @ + /|/|@ + > < @ +|/|/ @ + @@ +216 LATIN CAPITAL LETTER O WITH STROKE + _____ @ + / _// \@ + / //// /@ +/ //// / @ +\_//__/ @ + @@ +217 LATIN CAPITAL LETTER U WITH GRAVE + __ @ + __\_\_@ + / / / /@ +/ /_/ / @ +\____/ @ + @@ +218 LATIN CAPITAL LETTER U WITH ACUTE + __ @ + __/_/_@ + / / / /@ +/ /_/ / @ +\____/ @ + @@ +219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX + //| @ + _|/||_@ + / / / /@ +/ /_/ / @ +\____/ @ + @@ +220 LATIN CAPITAL LETTER U WITH DIAERESIS + _ _ @ + (_) (_)@ + / / / / @ +/ /_/ / @ +\____/ @ + @@ +221 LATIN CAPITAL LETTER Y WITH ACUTE + __ @ +__/_/_@ +\ \/ /@ + \ / @ + /_/ @ + @@ +222 LATIN CAPITAL LETTER THORN + __ @ + / /_ @ + / __ \@ + / ____/@ +/_/ @ + @@ +223 LATIN SMALL LETTER SHARP S + ____ @ + / __ \@ + / / / /@ + / /_| | @ + / //__/ @ +/_/ @@ +224 LATIN SMALL LETTER A WITH GRAVE + __ @ + __\_\_@ + / __ `/@ +/ /_/ / @ +\__,_/ @ + @@ +225 LATIN SMALL LETTER A WITH ACUTE + __ @ + __/_/_@ + / __ `/@ +/ /_/ / @ +\__,_/ @ + @@ +226 LATIN SMALL LETTER A WITH CIRCUMFLEX + //| @ + _|/||_@ + / __ `/@ +/ /_/ / @ +\__,_/ @ + @@ +227 LATIN SMALL LETTER A WITH TILDE + /\//@ + _//\/_@ + / __ `/@ +/ /_/ / @ +\__,_/ @ + @@ +228 LATIN SMALL LETTER A WITH DIAERESIS + _ _ @ + (_)_(_)@ + / __ `/ @ +/ /_/ / @ +\__,_/ @ + @@ +229 LATIN SMALL LETTER A WITH RING ABOVE + __ @ + __(())@ + / __ `/@ +/ /_/ / @ +\__,_/ @ + @@ +230 LATIN SMALL LETTER AE + @ + ____ ___ @ + / __ ` _ \@ +/ /_/ __/@ +\__,_____/ @ + @@ +231 LATIN SMALL LETTER C WITH CEDILLA + @ + _____@ + / ___/@ +/ /__ @ +\___/ @ +/_) @@ +232 LATIN SMALL LETTER E WITH GRAVE + __ @ + _\_\@ + / _ \@ +/ __/@ +\___/ @ + @@ +233 LATIN SMALL LETTER E WITH ACUTE + __@ + _/_/@ + / _ \@ +/ __/@ +\___/ @ + @@ +234 LATIN SMALL LETTER E WITH CIRCUMFLEX + //|@ + _|/||@ + / _ \ @ +/ __/ @ +\___/ @ + @@ +235 LATIN SMALL LETTER E WITH DIAERESIS + _ _ @ + (_)(_)@ + / _ \ @ +/ __/ @ +\___/ @ + @@ +236 LATIN SMALL LETTER I WITH GRAVE + __ @ + \_\@ + / / @ + / / @ +/_/ @ + @@ +237 LATIN SMALL LETTER I WITH ACUTE + __@ + /_/@ + / / @ + / / @ +/_/ @ + @@ +238 LATIN SMALL LETTER I WITH CIRCUMFLEX + //|@ + |/||@ + / / @ + / / @ +/_/ @ + @@ +239 LATIN SMALL LETTER I WITH DIAERESIS + _ _ @ + (_)_(_)@ + / / @ + / / @ +/_/ @ + @@ +240 LATIN SMALL LETTER ETH + || @ + =||=@ + ___ || @ +/ __` | @ +\____/ @ + @@ +241 LATIN SMALL LETTER N WITH TILDE + /\//@ + _//\/ @ + / __ \ @ + / / / / @ +/_/ /_/ @ + @@ +242 LATIN SMALL LETTER O WITH GRAVE + __ @ + __\_\@ + / __ \@ +/ /_/ /@ +\____/ @ + @@ +243 LATIN SMALL LETTER O WITH ACUTE + __@ + __/_/@ + / __ \@ +/ /_/ /@ +\____/ @ + @@ +244 LATIN SMALL LETTER O WITH CIRCUMFLEX + //|@ + _|/||@ + / __ \@ +/ /_/ /@ +\____/ @ + @@ +245 LATIN SMALL LETTER O WITH TILDE + /\//@ + _//\/ @ + / __ \ @ +/ /_/ / @ +\____/ @ + @@ +246 LATIN SMALL LETTER O WITH DIAERESIS + _ _ @ + (_)_(_)@ + / __ \ @ +/ /_/ / @ +\____/ @ + @@ +247 DIVISION SIGN + @ + _ @ + __(_)_@ +/_____/@ + (_) @ + @@ +248 LATIN SMALL LETTER O WITH STROKE + @ + _____ @ + / _// \@ +/ //// /@ +\_//__/ @ + @@ +249 LATIN SMALL LETTER U WITH GRAVE + __ @ + __\_\_@ + / / / /@ +/ /_/ / @ +\__,_/ @ + @@ +250 LATIN SMALL LETTER U WITH ACUTE + __ @ + __/_/_@ + / / / /@ +/ /_/ / @ +\__,_/ @ + @@ +251 LATIN SMALL LETTER U WITH CIRCUMFLEX + //| @ + _|/||_@ + / / / /@ +/ /_/ / @ +\__,_/ @ + @@ +252 LATIN SMALL LETTER U WITH DIAERESIS + _ _ @ + (_) (_)@ + / / / / @ +/ /_/ / @ +\__,_/ @ + @@ +253 LATIN SMALL LETTER Y WITH ACUTE + __ @ + __/_/_@ + / / / /@ + / /_/ / @ + \__, / @ +/____/ @@ +254 LATIN SMALL LETTER THORN + __ @ + / /_ @ + / __ \@ + / /_/ /@ + / .___/ @ +/_/ @@ +255 LATIN SMALL LETTER Y WITH DIAERESIS + _ _ @ + (_) (_)@ + / / / / @ + / /_/ / @ + \__, / @ +/____/ @@ diff --git a/src/app/small.flf b/src/app/small.flf new file mode 100644 index 0000000..d2a2c49 --- /dev/null +++ b/src/app/small.flf @@ -0,0 +1,1097 @@ +flf2a$ 5 4 13 15 10 0 22415 +Small by Glenn Chappell 4/93 -- based on Standard +Includes ISO Latin-1 +figlet release 2.1 -- 12 Aug 1994 +Permission is hereby given to modify this font, as long as the +modifier's name is placed on a comment line. + +Modified by Paul Burton 12/96 to include new parameter +supported by FIGlet and FIGWin. May also be slightly modified for better use +of new full-width/kern/smush alternatives, but default output is NOT changed. + + $@ + $@ + $@ + $@ + $@@ + _ @ + | |@ + |_|@ + (_)@ + @@ + _ _ @ + ( | )@ + V V @ + $ @ + @@ + _ _ @ + _| | |_ @ + |_ . _|@ + |_ _|@ + |_|_| @@ + @ + ||_@ + (_-<@ + / _/@ + || @@ + _ __ @ + (_)/ / @ + / /_ @ + /_/(_)@ + @@ + __ @ + / _|___ @ + > _|_ _|@ + \_____| @ + @@ + _ @ + ( )@ + |/ @ + $ @ + @@ + __@ + / /@ + | | @ + | | @ + \_\@@ + __ @ + \ \ @ + | |@ + | |@ + /_/ @@ + @ + _/\_@ + > <@ + \/ @ + @@ + _ @ + _| |_ @ + |_ _|@ + |_| @ + @@ + @ + @ + _ @ + ( )@ + |/ @@ + @ + ___ @ + |___|@ + $ @ + @@ + @ + @ + _ @ + (_)@ + @@ + __@ + / /@ + / / @ + /_/ @ + @@ + __ @ + / \ @ + | () |@ + \__/ @ + @@ + _ @ + / |@ + | |@ + |_|@ + @@ + ___ @ + |_ )@ + / / @ + /___|@ + @@ + ____@ + |__ /@ + |_ \@ + |___/@ + @@ + _ _ @ + | | | @ + |_ _|@ + |_| @ + @@ + ___ @ + | __|@ + |__ \@ + |___/@ + @@ + __ @ + / / @ + / _ \@ + \___/@ + @@ + ____ @ + |__ |@ + / / @ + /_/ @ + @@ + ___ @ + ( _ )@ + / _ \@ + \___/@ + @@ + ___ @ + / _ \@ + \_, /@ + /_/ @ + @@ + _ @ + (_)@ + _ @ + (_)@ + @@ + _ @ + (_)@ + _ @ + ( )@ + |/ @@ + __@ + / /@ + < < @ + \_\@ + @@ + @ + ___ @ + |___|@ + |___|@ + @@ + __ @ + \ \ @ + > >@ + /_/ @ + @@ + ___ @ + |__ \@ + /_/@ + (_) @ + @@ + ____ @ + / __ \ @ + / / _` |@ + \ \__,_|@ + \____/ @@ + _ @ + /_\ @ + / _ \ @ + /_/ \_\@ + @@ + ___ @ + | _ )@ + | _ \@ + |___/@ + @@ + ___ @ + / __|@ + | (__ @ + \___|@ + @@ + ___ @ + | \ @ + | |) |@ + |___/ @ + @@ + ___ @ + | __|@ + | _| @ + |___|@ + @@ + ___ @ + | __|@ + | _| @ + |_| @ + @@ + ___ @ + / __|@ + | (_ |@ + \___|@ + @@ + _ _ @ + | || |@ + | __ |@ + |_||_|@ + @@ + ___ @ + |_ _|@ + | | @ + |___|@ + @@ + _ @ + _ | |@ + | || |@ + \__/ @ + @@ + _ __@ + | |/ /@ + | ' < @ + |_|\_\@ + @@ + _ @ + | | @ + | |__ @ + |____|@ + @@ + __ __ @ + | \/ |@ + | |\/| |@ + |_| |_|@ + @@ + _ _ @ + | \| |@ + | .` |@ + |_|\_|@ + @@ + ___ @ + / _ \ @ + | (_) |@ + \___/ @ + @@ + ___ @ + | _ \@ + | _/@ + |_| @ + @@ + ___ @ + / _ \ @ + | (_) |@ + \__\_\@ + @@ + ___ @ + | _ \@ + | /@ + |_|_\@ + @@ + ___ @ + / __|@ + \__ \@ + |___/@ + @@ + _____ @ + |_ _|@ + | | @ + |_| @ + @@ + _ _ @ + | | | |@ + | |_| |@ + \___/ @ + @@ + __ __@ + \ \ / /@ + \ V / @ + \_/ @ + @@ + __ __@ + \ \ / /@ + \ \/\/ / @ + \_/\_/ @ + @@ + __ __@ + \ \/ /@ + > < @ + /_/\_\@ + @@ + __ __@ + \ \ / /@ + \ V / @ + |_| @ + @@ + ____@ + |_ /@ + / / @ + /___|@ + @@ + __ @ + | _|@ + | | @ + | | @ + |__|@@ + __ @ + \ \ @ + \ \ @ + \_\@ + @@ + __ @ + |_ |@ + | |@ + | |@ + |__|@@ + /\ @ + |/\|@ + $ @ + $ @ + @@ + @ + @ + @ + ___ @ + |___|@@ + _ @ + ( )@ + \|@ + $ @ + @@ + @ + __ _ @ + / _` |@ + \__,_|@ + @@ + _ @ + | |__ @ + | '_ \@ + |_.__/@ + @@ + @ + __ @ + / _|@ + \__|@ + @@ + _ @ + __| |@ + / _` |@ + \__,_|@ + @@ + @ + ___ @ + / -_)@ + \___|@ + @@ + __ @ + / _|@ + | _|@ + |_| @ + @@ + @ + __ _ @ + / _` |@ + \__, |@ + |___/ @@ + _ @ + | |_ @ + | ' \ @ + |_||_|@ + @@ + _ @ + (_)@ + | |@ + |_|@ + @@ + _ @ + (_)@ + | |@ + _/ |@ + |__/ @@ + _ @ + | |__@ + | / /@ + |_\_\@ + @@ + _ @ + | |@ + | |@ + |_|@ + @@ + @ + _ __ @ + | ' \ @ + |_|_|_|@ + @@ + @ + _ _ @ + | ' \ @ + |_||_|@ + @@ + @ + ___ @ + / _ \@ + \___/@ + @@ + @ + _ __ @ + | '_ \@ + | .__/@ + |_| @@ + @ + __ _ @ + / _` |@ + \__, |@ + |_|@@ + @ + _ _ @ + | '_|@ + |_| @ + @@ + @ + ___@ + (_-<@ + /__/@ + @@ + _ @ + | |_ @ + | _|@ + \__|@ + @@ + @ + _ _ @ + | || |@ + \_,_|@ + @@ + @ + __ __@ + \ V /@ + \_/ @ + @@ + @ + __ __ __@ + \ V V /@ + \_/\_/ @ + @@ + @ + __ __@ + \ \ /@ + /_\_\@ + @@ + @ + _ _ @ + | || |@ + \_, |@ + |__/ @@ + @ + ___@ + |_ /@ + /__|@ + @@ + __@ + / /@ + _| | @ + | | @ + \_\@@ + _ @ + | |@ + | |@ + | |@ + |_|@@ + __ @ + \ \ @ + | |_@ + | | @ + /_/ @@ + /\/|@ + |/\/ @ + $ @ + $ @ + @@ + _ _ @ + (_)(_)@ + /--\ @ + /_/\_\@ + @@ + _ _ @ + (_)(_)@ + / __ \@ + \____/@ + @@ + _ _ @ + (_) (_)@ + | |_| |@ + \___/ @ + @@ + _ _ @ + (_)(_)@ + / _` |@ + \__,_|@ + @@ + _ _ @ + (_)_(_)@ + / _ \ @ + \___/ @ + @@ + _ _ @ + (_)(_)@ + | || |@ + \_,_|@ + @@ + ___ @ + / _ \@ + | |< <@ + | ||_/@ + |_| @@ +160 NO-BREAK SPACE + $@ + $@ + $@ + $@ + $@@ +161 INVERTED EXCLAMATION MARK + _ @ + (_)@ + | |@ + |_|@ + @@ +162 CENT SIGN + @ + || @ + / _)@ + \ _)@ + || @@ +163 POUND SIGN + __ @ + _/ _\ @ + |_ _|_ @ + (_,___|@ + @@ +164 CURRENCY SIGN + /\_/\@ + \ . /@ + / _ \@ + \/ \/@ + @@ +165 YEN SIGN + __ __ @ + \ V / @ + |__ __|@ + |__ __|@ + |_| @@ +166 BROKEN BAR + _ @ + | |@ + |_|@ + | |@ + |_|@@ +167 SECTION SIGN + __ @ + / _)@ + /\ \ @ + \ \/ @ + (__/ @@ +168 DIAERESIS + _ _ @ + (_)(_)@ + $ $ @ + $ $ @ + @@ +169 COPYRIGHT SIGN + ____ @ + / __ \ @ + / / _| \@ + \ \__| /@ + \____/ @@ +170 FEMININE ORDINAL INDICATOR + __ _ @ + / _` |@ + \__,_|@ + |____|@ + @@ +171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + ____@ + / / /@ + < < < @ + \_\_\@ + @@ +172 NOT SIGN + ____ @ + |__ |@ + |_|@ + $ @ + @@ +173 SOFT HYPHEN + @ + __ @ + |__|@ + $ @ + @@ +174 REGISTERED SIGN + ____ @ + / __ \ @ + / | -) \@ + \ ||\\ /@ + \____/ @@ +175 MACRON + ___ @ + |___|@ + $ @ + $ @ + @@ +176 DEGREE SIGN + _ @ + /.\@ + \_/@ + $ @ + @@ +177 PLUS-MINUS SIGN + _ @ + _| |_ @ + |_ _|@ + _|_|_ @ + |_____|@@ +178 SUPERSCRIPT TWO + __ @ + |_ )@ + /__|@ + $ @ + @@ +179 SUPERSCRIPT THREE + ___@ + |_ /@ + |__)@ + $ @ + @@ +180 ACUTE ACCENT + __@ + /_/@ + $ @ + $ @ + @@ +181 MICRO SIGN + @ + _ _ @ + | || |@ + | .,_|@ + |_| @@ +182 PILCROW SIGN + ____ @ + / |@ + \_ | |@ + |_|_|@ + @@ +183 MIDDLE DOT + @ + _ @ + (_)@ + $ @ + @@ +184 CEDILLA + @ + @ + @ + _ @ + )_)@@ +185 SUPERSCRIPT ONE + _ @ + / |@ + |_|@ + $ @ + @@ +186 MASCULINE ORDINAL INDICATOR + ___ @ + / _ \@ + \___/@ + |___|@ + @@ +187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + ____ @ + \ \ \ @ + > > >@ + /_/_/ @ + @@ +188 VULGAR FRACTION ONE QUARTER + _ __ @ + / |/ /__ @ + |_/ /_' |@ + /_/ |_|@ + @@ +189 VULGAR FRACTION ONE HALF + _ __ @ + / |/ /_ @ + |_/ /_ )@ + /_//__|@ + @@ +190 VULGAR FRACTION THREE QUARTERS + ___ __ @ + |_ // /__ @ + |__) /_' |@ + /_/ |_|@ + @@ +191 INVERTED QUESTION MARK + _ @ + (_) @ + / /_ @ + \___|@ + @@ +192 LATIN CAPITAL LETTER A WITH GRAVE + __ @ + \_\ @ + /--\ @ + /_/\_\@ + @@ +193 LATIN CAPITAL LETTER A WITH ACUTE + __ @ + /_/ @ + /--\ @ + /_/\_\@ + @@ +194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX + /\ @ + |/\| @ + /--\ @ + /_/\_\@ + @@ +195 LATIN CAPITAL LETTER A WITH TILDE + /\/|@ + |/\/ @ + /--\ @ + /_/\_\@ + @@ +196 LATIN CAPITAL LETTER A WITH DIAERESIS + _ _ @ + (_)(_)@ + /--\ @ + /_/\_\@ + @@ +197 LATIN CAPITAL LETTER A WITH RING ABOVE + __ @ + (()) @ + /--\ @ + /_/\_\@ + @@ +198 LATIN CAPITAL LETTER AE + ____ @ + /, __|@ + / _ _| @ + /_/|___|@ + @@ +199 LATIN CAPITAL LETTER C WITH CEDILLA + ___ @ + / __|@ + | (__ @ + \___|@ + )_) @@ +200 LATIN CAPITAL LETTER E WITH GRAVE + __ @ + \_\@ + | -<@ + |__<@ + @@ +201 LATIN CAPITAL LETTER E WITH ACUTE + __@ + /_/@ + | -<@ + |__<@ + @@ +202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX + /\ @ + |/\|@ + | -<@ + |__<@ + @@ +203 LATIN CAPITAL LETTER E WITH DIAERESIS + _ _ @ + (_)(_)@ + | -< @ + |__< @ + @@ +204 LATIN CAPITAL LETTER I WITH GRAVE + __ @ + \_\ @ + |_ _|@ + |___|@ + @@ +205 LATIN CAPITAL LETTER I WITH ACUTE + __ @ + /_/ @ + |_ _|@ + |___|@ + @@ +206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX + //\ @ + |/_\|@ + |_ _|@ + |___|@ + @@ +207 LATIN CAPITAL LETTER I WITH DIAERESIS + _ _ @ + (_)_(_)@ + |_ _| @ + |___| @ + @@ +208 LATIN CAPITAL LETTER ETH + ____ @ + | __ \ @ + |_ _|) |@ + |____/ @ + @@ +209 LATIN CAPITAL LETTER N WITH TILDE + /\/|@ + |/\/ @ + | \| |@ + |_|\_|@ + @@ +210 LATIN CAPITAL LETTER O WITH GRAVE + __ @ + \_\_ @ + / __ \@ + \____/@ + @@ +211 LATIN CAPITAL LETTER O WITH ACUTE + __ @ + _/_/ @ + / __ \@ + \____/@ + @@ +212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX + /\ @ + |/\| @ + / __ \@ + \____/@ + @@ +213 LATIN CAPITAL LETTER O WITH TILDE + /\/|@ + |/\/ @ + / __ \@ + \____/@ + @@ +214 LATIN CAPITAL LETTER O WITH DIAERESIS + _ _ @ + (_)(_)@ + / __ \@ + \____/@ + @@ +215 MULTIPLICATION SIGN + @ + /\/\@ + > <@ + \/\/@ + @@ +216 LATIN CAPITAL LETTER O WITH STROKE + ____ @ + / _//\ @ + | (//) |@ + \//__/ @ + @@ +217 LATIN CAPITAL LETTER U WITH GRAVE + __ @ + _\_\_ @ + | |_| |@ + \___/ @ + @@ +218 LATIN CAPITAL LETTER U WITH ACUTE + __ @ + _/_/_ @ + | |_| |@ + \___/ @ + @@ +219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX + //\ @ + |/ \| @ + | |_| |@ + \___/ @ + @@ +220 LATIN CAPITAL LETTER U WITH DIAERESIS + _ _ @ + (_) (_)@ + | |_| |@ + \___/ @ + @@ +221 LATIN CAPITAL LETTER Y WITH ACUTE + __ @ + _/_/_@ + \ V /@ + |_| @ + @@ +222 LATIN CAPITAL LETTER THORN + _ @ + | |_ @ + | -_)@ + |_| @ + @@ +223 LATIN SMALL LETTER SHARP S + ___ @ + / _ \@ + | |< <@ + | ||_/@ + |_| @@ +224 LATIN SMALL LETTER A WITH GRAVE + __ @ + \_\_ @ + / _` |@ + \__,_|@ + @@ +225 LATIN SMALL LETTER A WITH ACUTE + __ @ + _/_/ @ + / _` |@ + \__,_|@ + @@ +226 LATIN SMALL LETTER A WITH CIRCUMFLEX + /\ @ + |/\| @ + / _` |@ + \__,_|@ + @@ +227 LATIN SMALL LETTER A WITH TILDE + /\/|@ + |/\/ @ + / _` |@ + \__,_|@ + @@ +228 LATIN SMALL LETTER A WITH DIAERESIS + _ _ @ + (_)(_)@ + / _` |@ + \__,_|@ + @@ +229 LATIN SMALL LETTER A WITH RING ABOVE + __ @ + (()) @ + / _` |@ + \__,_|@ + @@ +230 LATIN SMALL LETTER AE + @ + __ ___ @ + / _` -_)@ + \__,___|@ + @@ +231 LATIN SMALL LETTER C WITH CEDILLA + @ + __ @ + / _|@ + \__|@ + )_)@@ +232 LATIN SMALL LETTER E WITH GRAVE + __ @ + \_\ @ + / -_)@ + \___|@ + @@ +233 LATIN SMALL LETTER E WITH ACUTE + __ @ + /_/ @ + / -_)@ + \___|@ + @@ +234 LATIN SMALL LETTER E WITH CIRCUMFLEX + //\ @ + |/_\|@ + / -_)@ + \___|@ + @@ +235 LATIN SMALL LETTER E WITH DIAERESIS + _ _ @ + (_)_(_)@ + / -_) @ + \___| @ + @@ +236 LATIN SMALL LETTER I WITH GRAVE + __ @ + \_\@ + | |@ + |_|@ + @@ +237 LATIN SMALL LETTER I WITH ACUTE + __@ + /_/@ + | |@ + |_|@ + @@ +238 LATIN SMALL LETTER I WITH CIRCUMFLEX + //\ @ + |/_\|@ + | | @ + |_| @ + @@ +239 LATIN SMALL LETTER I WITH DIAERESIS + _ _ @ + (_)_(_)@ + | | @ + |_| @ + @@ +240 LATIN SMALL LETTER ETH + \\/\ @ + \/\\ @ + / _` |@ + \___/ @ + @@ +241 LATIN SMALL LETTER N WITH TILDE + /\/| @ + |/\/ @ + | ' \ @ + |_||_|@ + @@ +242 LATIN SMALL LETTER O WITH GRAVE + __ @ + \_\ @ + / _ \@ + \___/@ + @@ +243 LATIN SMALL LETTER O WITH ACUTE + __ @ + /_/ @ + / _ \@ + \___/@ + @@ +244 LATIN SMALL LETTER O WITH CIRCUMFLEX + //\ @ + |/_\|@ + / _ \@ + \___/@ + @@ +245 LATIN SMALL LETTER O WITH TILDE + /\/|@ + |/\/ @ + / _ \@ + \___/@ + @@ +246 LATIN SMALL LETTER O WITH DIAERESIS + _ _ @ + (_)_(_)@ + / _ \ @ + \___/ @ + @@ +247 DIVISION SIGN + _ @ + (_) @ + |___|@ + (_) @ + @@ +248 LATIN SMALL LETTER O WITH STROKE + @ + ___ @ + / //\@ + \//_/@ + @@ +249 LATIN SMALL LETTER U WITH GRAVE + __ @ + \_\_ @ + | || |@ + \_,_|@ + @@ +250 LATIN SMALL LETTER U WITH ACUTE + __ @ + _/_/ @ + | || |@ + \_,_|@ + @@ +251 LATIN SMALL LETTER U WITH CIRCUMFLEX + /\ @ + |/\| @ + | || |@ + \_,_|@ + @@ +252 LATIN SMALL LETTER U WITH DIAERESIS + _ _ @ + (_)(_)@ + | || |@ + \_,_|@ + @@ +253 LATIN SMALL LETTER Y WITH ACUTE + __ @ + _/_/ @ + | || |@ + \_, |@ + |__/ @@ +254 LATIN SMALL LETTER THORN + _ @ + | |__ @ + | '_ \@ + | .__/@ + |_| @@ +255 LATIN SMALL LETTER Y WITH DIAERESIS + _ _ @ + (_)(_)@ + | || |@ + \_, |@ + |__/ @@ diff --git a/src/app/speed.flf b/src/app/speed.flf new file mode 100644 index 0000000..d294c52 --- /dev/null +++ b/src/app/speed.flf @@ -0,0 +1,1301 @@ +flf2a$ 6 5 16 15 16 +Speed by Claude Martins 2/95 -- based on Slant +Includes ISO Latin-1 +figlet release 2.1 -- 12 Aug 1994 +Permission is hereby given to modify this font, as long as the +modifier's name is placed on a comment line. + +Explanation of first line: +flf2 - "magic number" for file identification +a - should always be `a', for now +$ - the "hardblank" -- prints as a blank, but can't be smushed +6 - height of a character +5 - height of a character, not including descenders +14 - max line length (excluding comment lines) + a fudge factor +15 - default smushmode for this font +16 - number of comment lines + + $$@ + $$ @ + $$ @ + $$ @ + $$ @ +$$ @@ +______@ +___ /@ +__ / @ + /_/ @ +(_) @ + @@ +___ _ @ +_( | )@ +_|/|/ @ + $ @ + $ @ + @@ +_______ __ @ +____/ // /_@ +_ _ _ __/@ +/_ _ __/ @ + /_//_/ @ + @@ +_______@ +____/ /@ +__ __/@ +_(_ ) @ +/ _/ @ +/_/ @@ +____ __@ +__(_)_/_/@ +____/_/ @ +__/_/_ @ +/_/ (_) @ + @@ +______ @ +__( _ ) @ +_ __ \/|@ +/ /_/ < @ +\____/\/ @ + @@ +___ @ +_( )@ +_|/ @ + $ @ +$ @ + @@ +_______@ +____/_/@ +__ / @ +_ / @ +/ / @ +|_| @@ +______ @ +____| |@ +____ /@ +___ / @ +__/_/ @ +/_/ @@ +_____ @ +____/|_@ +_| /@ +/_ __| @ + |/ @ + @@ + @ +______ @ +___/ /_@ +/_ __/@ + /_/ @ + @@ + @ + @ + @ +___ @ +_( )@ +_|/ @@ + @ + @ +________@ +_/_____/@ + $ @ + @@ + @ + @ + @ +___ @ +_(_)@ + @@ +_________@ +______/_/@ +____/_/ @ +__/_/ @ +/_/ @ + @@ +_______ @ +__ __ \@ +_ / / /@ +/ /_/ / @ +\____/ @ + @@ +______@ +__< /@ +__ / @ +_ / @ +/_/ @ + @@ +______ @ +__|__ \@ +____/ /@ +_ __/ @ +/____/ @ + @@ +________@ +__|__ /@ +___/_ < @ +____/ / @ +/____/ @ + @@ +_____ __@ +__ // /@ +_ // /_@ +/__ __/@ + /_/ @ + @@ +__________@ +___ ____/@ +______ \ @ + ____/ / @ +/_____/ @ + @@ +________@ +__ ___/@ +_ __ \ @ +/ /_/ / @ +\____/ @ + @@ +______@ +/__ /@ +__ / @ +_ / @ +/_/ @ + @@ +_______ @ +__( __ )@ +_ __ |@ +/ /_/ / @ +\____/ @ + @@ +_______ @ +__ __ \@ +_ /_/ /@ +_\__, / @ +/____/ @ + @@ + @ +_____ @ +___(_)@ +___ @ +_(_) @ + @@ + @ +_____ @ +___(_)@ +___ @ +_( ) @ +_|/ @@ +____@ +_ /@ +/ / @ +\ \ @ + \_\@ + @@ + @ +_______@ +_ ____/@ +/____/ @ + $ @ + @@ +___ @ +__ \ @ +___ \@ +__ /@ +_/_/ @ + @@ +_____ @ +_ __ \@ +__/ _/@ +_/_/ @ +(_) @ + @@ +_________ @ +__ ____ \@ +_ / __ `/@ +/ / /_/ / @ +\ \__,_/ @ + \____/ @@ +_______ @ +___ |@ +__ /| |@ +_ ___ |@ +/_/ |_|@ + @@ +________ @ +___ __ )@ +__ __ |@ +_ /_/ / @ +/_____/ @ + @@ +_________@ +__ ____/@ +_ / @ +/ /___ @ +\____/ @ + @@ +________ @ +___ __ \@ +__ / / /@ +_ /_/ / @ +/_____/ @ + @@ +__________@ +___ ____/@ +__ __/ @ +_ /___ @ +/_____/ @ + @@ +__________@ +___ ____/@ +__ /_ @ +_ __/ @ +/_/ @ + @@ +_________@ +__ ____/@ +_ / __ @ +/ /_/ / @ +\____/ @ + @@ +______ __@ +___ / / /@ +__ /_/ / @ +_ __ / @ +/_/ /_/ @ + @@ +________@ +____ _/@ + __ / @ +__/ / @ +/___/ @ + @@ +_________@ +______ /@ +___ _ / @ +/ /_/ / @ +\____/ @ + @@ +______ __@ +___ //_/@ +__ ,< @ +_ /| | @ +/_/ |_| @ + @@ +______ @ +___ / @ +__ / @ +_ /___@ +/_____/@ + @@ +______ ___@ +___ |/ /@ +__ /|_/ / @ +_ / / / @ +/_/ /_/ @ + @@ +_____ __@ +___ | / /@ +__ |/ / @ +_ /| / @ +/_/ |_/ @ + @@ +_______ @ +__ __ \@ +_ / / /@ +/ /_/ / @ +\____/ @ + @@ +________ @ +___ __ \@ +__ /_/ /@ +_ ____/ @ +/_/ @ + @@ +_______ @ +__ __ \@ +_ / / /@ +/ /_/ / @ +\___\_\ @ + @@ +________ @ +___ __ \@ +__ /_/ /@ +_ _, _/ @ +/_/ |_| @ + @@ +________@ +__ ___/@ +_____ \ @ +____/ / @ +/____/ @ + @@ +________@ +___ __/@ +__ / @ +_ / @ +/_/ @ + @@ +_____ __@ +__ / / /@ +_ / / / @ +/ /_/ / @ +\____/ @ + @@ +___ __@ +__ | / /@ +__ | / / @ +__ |/ / @ +_____/ @ + @@ +___ __@ +__ | / /@ +__ | /| / / @ +__ |/ |/ / @ +____/|__/ @ + @@ +____ __@ +__ |/ /@ +__ / @ +_ | @ +/_/|_| @ + @@ +__ __@ +_ \/ /@ +__ / @ +_ / @ +/_/ @ + @@ +______@ +___ /@ +__ / @ +_ /__@ +/____/@ + @@ +________@ +____ _/@ +___ / @ +__ / @ +_ / @ +/__/ @@ +___ @ +__ \ @ +___ \ @ +____ \ @ +______\@ + @@ +________@ +____/ /@ +____ / @ +___ / @ +__/ / @ +/__/ @@ +_ //|@ +_|/||@ + $ @ + $ @ +$ @ + @@ + @ + @ + @ + @ +________@ +_/_____/@@ +___ @ +_( )@ +__V @ + $ @ +$ @ + @@ + @ +______ _@ +_ __ `/@ +/ /_/ / @ +\__,_/ @ + @@ +______ @ +___ /_ @ +__ __ \@ +_ /_/ /@ +/_.___/ @ + @@ + @ +_______@ +_ ___/@ +/ /__ @ +\___/ @ + @@ +_________@ +______ /@ +_ __ / @ +/ /_/ / @ +\__,_/ @ + @@ + @ +_____ @ +_ _ \@ +/ __/@ +\___/ @ + @@ +________@ +___ __/@ +__ /_ @ +_ __/ @ +/_/ @ + @@ + @ +_______ _@ +__ __ `/@ +_ /_/ / @ +_\__, / @ +/____/ @@ +______ @ +___ /_ @ +__ __ \@ +_ / / /@ +/_/ /_/ @ + @@ +_____ @ +___(_)@ +__ / @ +_ / @ +/_/ @ + @@ +________ @ +______(_)@ +_____ / @ +____ / @ +___ / @ +/___/ @@ +______ @ +___ /__@ +__ //_/@ +_ ,< @ +/_/|_| @ + @@ +______@ +___ /@ +__ / @ +_ / @ +/_/ @ + @@ + @ +_______ ___ @ +__ __ `__ \@ +_ / / / / /@ +/_/ /_/ /_/ @ + @@ + @ +_______ @ +__ __ \@ +_ / / /@ +/_/ /_/ @ + @@ + @ +______ @ +_ __ \@ +/ /_/ /@ +\____/ @ + @@ + @ +________ @ +___ __ \@ +__ /_/ /@ +_ .___/ @ +/_/ @@ + @ +______ _@ +_ __ `/@ +/ /_/ / @ +\__, / @ + /_/ @@ + @ +________@ +__ ___/@ +_ / @ +/_/ @ + @@ + @ +________@ +__ ___/@ +_(__ ) @ +/____/ @ + @@ +_____ @ +__ /_@ +_ __/@ +/ /_ @ +\__/ @ + @@ + @ +____ __@ +_ / / /@ +/ /_/ / @ +\__,_/ @ + @@ + @ +___ __@ +__ | / /@ +__ |/ / @ +_____/ @ + @@ + @ +___ __@ +__ | /| / /@ +__ |/ |/ / @ +____/|__/ @ + @@ + @ +____ __@ +__ |/_/@ +__> < @ +/_/|_| @ + @@ + @ +_____ __@ +__ / / /@ +_ /_/ / @ +_\__, / @ +/____/ @@ + @ +______@ +___ /@ +__ /_@ +_____/@ + @@ +_______@ +____/_/@ +__/_/ @ +< < @ +/ / @ +\_\ @@ +_______@ +____ /@ +___ / @ +__ / @ +_ / @ +/_/ @@ +____ _ @ +____| |@ +____/ /@ +____>_>@ +__/_/ @ +/_/ @@ +__/\//@ +_//\/ @ + $ @ + $ @ +$ @ + @@ +_____ _ @ +___(_)(_)@ +__ _ | @ +_ __ | @ +/_/ |_| @ + @@ +____ _ @ +__(_)_(_)@ +_ __ \ @ +/ /_/ / @ +\____/ @ + @@ +____ _ @ +__(_) (_)@ +_ / / / @ +/ /_/ / @ +\____/ @ + @@ +____ _ @ +__(_)_(_)@ +_ __ `/ @ +/ /_/ / @ +\__,_/ @ + @@ +____ _ @ +__(_)_(_)@ +_ __ \ @ +/ /_/ / @ +\____/ @ + @@ +____ _ @ +__(_) (_)@ +_ / / / @ +/ /_/ / @ +\__,_/ @ + @@ +_________ @ +____ __ \@ +___ / / /@ +__ /_| | @ +_ //__/ @ +/_/ @@ +160 + $$@ + $$ @ + $$ @ + $$ @ + $$ @ +$$ @@ +161 +_____ @ +___(_)@ +__ / @ +_ / @ +/_/ @ + @@ +162 +_______@ +____/ /@ +_ ___/@ +/ /__ @ +\ _/ @ +/_/ @@ +163 +_________ @ +____ ,__\@ +___/ /_ @ +__/ /___ @ +(_,____/ @ + @@ +164 +___ /|___/|@ +___| __ / @ +__ /_/ / @ +_ ___ | @ +|/ |/ @ + @@ +165 +___ ____@ +___| / /@ +_ _ __/@ +/_ __/ @ + /_/ @ + @@ +166 +_______@ +____ /@ +_____/ @ +____ @ +_ / @ +/_/ @@ +167 +_______ @ +____/ _)@ +__ | | @ +_| || | @ +_| |_/ @ +(__/ @@ +168 +___ _ @ +_(_) (_)@ + $ $ @ + $ $ @ +$ $ @ + @@ +169 +__________ @ +___ _____\ @ +__ / ___/ |@ +_ / /__ / @ +| \___/ / @ + \______/ @@ +170 +______ _@ +__ _ `/@ +__\_,_/ @ +/____/ @ + $ @ + @@ +171 +______@ +_ / /@ +/ / / @ +\ \ \ @ + \_\_\@ + @@ +172 + @ +________@ +_/___ /@ + /_/ @ + $ @ + @@ +173 + @ + @ +_______@ +_/____/@ + $ @ + @@ +174 +__________ @ +___ ___ \ @ +__ / _ \ |@ +_ / , _/ / @ +| /_/|_| / @ + \______/ @@ +175 +________@ +_/_____/@ + $ @ + $ @ + $ @ + @@ +176 +_____ @ +_ _ \@ +/ // /@ +\___/ @ + $ @ + @@ +177 +________ @ +_____/ /_@ +____ __/@ +___/_/_ @ +/_____/ @ + @@ +178 +__ ___ @ +__|_ |@ +_ __/ @ +/____/ @ + $ @ + @@ +179 +__ ____@ +__|_ /@ +__/_ < @ +/____/ @ + $ @ + @@ +180 +____@ +_/_/@ + $ @ + $ @ +$ @ + @@ +181 + @ +______ __@ +___ / / /@ +__ /_/ / @ +_ ._,_/ @ +/_/ @@ +182 +_________@ +_ _ /@ +/ (/ / / @ +\_ / / @ + /_/_/ @ + @@ +183 + @ +___ @ +_(_)@ + $ @ + $ @ + @@ +184 + @ + @ + @ + @ +___ @ +_/_)@@ +185 +_____@ +_< /@ +_ / @ +/_/ @ +$ @ + @@ +186 +______ @ +__ _ \@ +__\___/@ +/____/ @ + $ @ + @@ +187 +_____ @ +__ \ \ @ +___ \ \@ +__ / /@ +___/_/ @ + @@ +188 +_____ __ @ +_< / _/_/ @ +_/ /_/_/___@ +/_//_// / /@ + /_/ /_ _/@ + /_/ @@ +189 +_____ __ @ +_< / _/_/__ @ +_/ /_/_/|_ |@ +/_//_/ / __/ @ + /_/ /____/ @ + @@ +190 +__ ____ __ @ +__|_ / _/_/ @ +__/_ < _/_/___@ +/____//_// / /@ + /_/ /_ _/@ + /_/ @@ +191 +___ _ @ +___(_)@ +__ / @ +/ _/_ @ +\___/ @ + @@ +192 +______ @ +____\_\@ +__ _ |@ +_ __ |@ +/_/ |_|@ + @@ +193 +_______@ +____/_/@ +__ _ |@ +_ __ |@ +/_/ |_|@ + @@ +194 +____ //|@ +____|/||@ +__ _ | @ +_ __ | @ +/_/ |_| @ + @@ +195 +_____/\//@ +____//\/ @ +__ _ | @ +_ __ | @ +/_/ |_| @ + @@ +196 +_____ _ @ +___(_)(_)@ +__ _ | @ +_ __ | @ +/_/ |_| @ + @@ +197 +____(())@ +___ |@ +__ /| |@ +_ ___ |@ +/_/ |_|@ + @@ +198 +______________@ +___ ____/@ +__ /| __/ @ +_ __ /___ @ +/_/ /_____/ @ + @@ +199 +_________@ +__ ____/@ +_ / @ +/ /___ @ +\____/ @ + /_) @@ +200 +______ @ +____\_\@ +__ __/@ +_ _/ @ +/___/ @ + @@ +201 +_______@ +____/_/@ +__ __/@ +_ _/ @ +/___/ @ + @@ +202 +____ //|@ +____|/||@ +__ __/ @ +_ _/ @ +/___/ @ + @@ +203 +_____ _ @ +___(_)(_)@ +__ __/ @ +_ _/ @ +/___/ @ + @@ +204 +______ @ +____\_\@ +__ _/@ +__/ / @ +/___/ @ + @@ +205 +_______@ +____/_/@ +__ _/@ +__/ / @ +/___/ @ + @@ +206 +____ //|@ +____|/||@ +__ _/ @ +__/ / @ +/___/ @ + @@ +207 +_____ _ @ +___(_)(_)@ +__ _/ @ +__/ / @ +/___/ @ + @@ +208 +_________ @ +____ __ \@ +___ /_/ /@ +/_ __/ / @ + /_____/ @ + @@ +209 +_____/\//@ +____//\/ @ +__ |/ / @ +_ / @ +/_/|_/ @ + @@ +210 +______ @ +____\_\@ +_ __ \@ +/ /_/ /@ +\____/ @ + @@ +211 +_______@ +____/_/@ +_ __ \@ +/ /_/ /@ +\____/ @ + @@ +212 +___ //|@ +___|/||@ +_ __ \@ +/ /_/ /@ +\____/ @ + @@ +213 +____/\//@ +___//\/ @ +_ __ \ @ +/ /_/ / @ +\____/ @ + @@ +214 +____ _ @ +__(_)_(_)@ +_ __ \ @ +/ /_/ / @ +\____/ @ + @@ +215 + @ +__ @ +_/|/|@ + > < @ +|/|/ @ + @@ +216 +________ @ +__ _// \@ +_ //// /@ +/ //// / @ +\_//__/ @ + @@ +217 +______ @ +____\_\_@ +_ / / /@ +/ /_/ / @ +\____/ @ + @@ +218 +_______ @ +____/_/_@ +_ / / /@ +/ /_/ / @ +\____/ @ + @@ +219 +___ //| @ +___|/||_@ +_ / / /@ +/ /_/ / @ +\____/ @ + @@ +220 +____ _ @ +__(_) (_)@ +_ / / / @ +/ /_/ / @ +\____/ @ + @@ +221 +______ @ +___/_/_@ +__ \/ /@ +___ / @ +__/_/ @ + @@ +222 +______ @ +___ /_ @ +__ __ \@ +_ ____/@ +/_/ @ + @@ +223 +_________ @ +____ __ \@ +___ / / /@ +__ /_| | @ +_ //__/ @ +/_/ @@ +224 +______ @ +____\_\_@ +_ __ `/@ +/ /_/ / @ +\__,_/ @ + @@ +225 +_______ @ +____/_/_@ +_ __ `/@ +/ /_/ / @ +\__,_/ @ + @@ +226 +___ //| @ +___|/||_@ +_ __ `/@ +/ /_/ / @ +\__,_/ @ + @@ +227 +____/\//@ +___//\/_@ +_ __ `/@ +/ /_/ / @ +\__,_/ @ + @@ +228 +____ _ @ +__(_)_(_)@ +_ __ `/ @ +/ /_/ / @ +\__,_/ @ + @@ +229 +_______ @ +____(())@ +_ __ `/@ +/ /_/ / @ +\__,_/ @ + @@ +230 + @ +______ ___ @ +_ __ ` _ \@ +/ /_/ __/@ +\__,_____/ @ + @@ +231 + @ +_______@ +_ ___/@ +/ /__ @ +\___/ @ +/_) @@ +232 +_____ @ +___\_\@ +_ _ \@ +/ __/@ +\___/ @ + @@ +233 +______@ +___/_/@ +_ _ \@ +/ __/@ +\___/ @ + @@ +234 +___ //|@ +___|/||@ +_ _ \ @ +/ __/ @ +\___/ @ + @@ +235 +____ _ @ +__(_)(_)@ +_ _ \ @ +/ __/ @ +\___/ @ + @@ +236 +_____ @ +___\_\@ +__ / @ +_ / @ +/_/ @ + @@ +237 +______@ +___/_/@ +__ / @ +_ / @ +/_/ @ + @@ +238 +___ //|@ +___|/||@ +__ / @ +_ / @ +/_/ @ + @@ +239 +_ _ _ @ +_(_)_(_)@ +__/ / @ +_ / @ +/_/ @ + @@ +240 +____ || @ +____=||=@ +____ || @ +/ __` | @ +\____/ @ + @@ +241 +_____/\//@ +____//\/ @ +__ __ \ @ +_ / / / @ +/_/ /_/ @ + @@ +242 +______ @ +____\_\@ +_ __ \@ +/ /_/ /@ +\____/ @ + @@ +243 +_______@ +____/_/@ +_ __ \@ +/ /_/ /@ +\____/ @ + @@ +244 +___ //|@ +___|/||@ +_ __ \@ +/ /_/ /@ +\____/ @ + @@ +245 +____/\//@ +___//\/ @ +_ __ \ @ +/ /_/ / @ +\____/ @ + @@ +246 +____ _ @ +__(_)_(_)@ +_ __ \ @ +/ /_/ / @ +\____/ @ + @@ +247 + @ +_____ @ +___(_)_@ +/_____/@ + (_) @ + @@ +248 + @ +_______ @ +_ _// \@ +/ //// /@ +\_//__/ @ + @@ +249 +______ @ +____\_\_@ +_ / / /@ +/ /_/ / @ +\__,_/ @ + @@ +250 +_______ @ +____/_/_@ +_ / / /@ +/ /_/ / @ +\__,_/ @ + @@ +251 +___ //| @ +___|/||_@ +_ / / /@ +/ /_/ / @ +\__,_/ @ + @@ +252 +____ _ @ +__(_) (_)@ +_ / / / @ +/ /_/ / @ +\__,_/ @ + @@ +253 +________ @ +_____/_/_@ +__ / / /@ +_ /_/ / @ +_\__, / @ +/____/ @@ +254 +_______ @ +____ /_ @ +___ __ \@ +__ /_/ /@ +_ .___/ @ +/_/ @@ +255 +_____ _ @ +___(_) (_)@ +__ / / / @ +_ /_/ / @ +_\__, / @ +/____/ @@ diff --git a/src/app/starwars.flf b/src/app/starwars.flf new file mode 100644 index 0000000..6ea55f0 --- /dev/null +++ b/src/app/starwars.flf @@ -0,0 +1,719 @@ +flf2a$ 7 6 22 15 4 +starwars.flf by Ryan Youck (youck@cs.uregina.ca) Dec 25/1994 +I am not responsible for use of this font +Based on Big.flf by Glenn Chappell + +$ $@ +$ $@ +$ $@ +$ $@ +$ $@ +$ $@ +$ $@@ + __ $@ +| |$@ +| |$@ +| |$@ +|__|$@ +(__)$@ + $@@ + _ _ @ +( | )@ + V V @ + $ @ + $ @ + $ @ + @@ + _ _ @ + _| || |_$@ +|_ __ _|@ + _| || |_ @ +|_ __ _|@ + |_||_| $@ + @@ + __,--,_.@ + / |@ + | (----`@ + \ \ $@ +.----) | $@ +|_ __/ $@ + '--' $@@ + _ ___$ @ + / \ / /$ @ +( o ) / / $ @ + \_/ / / _$ @ + / / / \ @ + / / ( o )@ + /__/ \_/ @@ + @ + ___ @ + ( _ ) $@ + / _ \/\@ +| (_> <@ + \___/\/@ + $@@ + __ @ +(_ )@ + |/ @ + $ @ + $ @ + $ @ + @@ + ___@ + / /@ +| |$@ +| |$@ +| |$@ +| |$@ + \__\@@ +___ @ +\ \ @ + | |@ + | |@ + | |@ + | |@ +/__/ @@ + _ @ + /\| |/\ @ + \ ` ' /$@ +|_ _|@ + / , . \$@ + \/|_|\/ @ + @@ + @ + _ @ + _| |_$@ +|_ _|@ + |_| $@ + $ @ + @@ + @ + @ + $ @ + $ @ + __ @ +(_ )@ + |/ @@ + @ + @ + ______ @ +|______|@ + $ @ + $ @ + @@ + @ + @ + @ + $ @ + __ @ +(__)@ + @@ + ___@ + / /@ + / / @ + / /$ @ + / /$ @ +/__/$ @ + @@ + ___ $@ + / _ \ $@ +| | | |$@ +| | | |$@ +| |_| |$@ + \___/ $@ + $@@ + __ $@ +/_ |$@ + | |$@ + | |$@ + | |$@ + |_|$@ + $@@ + ___ $@ +|__ \ $@ + $) |$@ + / / $@ + / /_ $@ +|____|$@ + $@@ + ____ $@ +|___ \ $@ + __) |$@ + |__ < $@ + ___) |$@ +|____/ $@ + $@@ + _ _ $@ +| || | $@ +| || |_ $@ +|__ _|$@ + | | $@ + |_| $@ + $@@ + _____ $@ +| ____|$@ +| |__ $@ +|___ \ $@ + ___) |$@ +|____/ $@ + $@@ + __ $@ + / / $@ + / /_ $@ +| '_ \ $@ +| (_) |$@ + \___/ $@ + $@@ + ______ $@ +|____ |$@ + $/ / $@ + / / $@ + / / $@ + /_/ $@ + $@@ + ___ $@ + / _ \ $@ +| (_) |$@ + > _ < $@ +| (_) |$@ + \___/ $@ + $@@ + ___ $@ + / _ \ $@ +| (_) |$@ + \__, |$@ + / / $@ + /_/ $@ + $@@ + @ + _ @ +(_)@ + $ @ + _ @ +(_)@ + @@ + @ + _ @ +(_)@ + $ @ + _ @ +( )@ +|/ @@ + ___@ + / /@ + / /$@ +< <$ @ + \ \$@ + \__\@ + @@ + @ + ______ @ +|______|@ + ______ @ +|______|@ + @ + @@ +___ @ +\ \$ @ + \ \ @ + > >@ + / / @ +/__/$ @ + @@ + ______ $@ +| \ $@ +`----) |$@ + / / $@ + |__| $@ + __ $@ + (__) $@@ + ____ @ + / __ \ @ + / / _` |@ +| | (_| |@ + \ \__,_|@ + \____/ @ + @@ + ___ $ @ + / \ $ @ + / ^ \$ @ + / /_\ \$ @ + / _____ \$ @ +/__/ \__\$@ + $@@ +.______ $@ +| _ \ $@ +| |_) |$@ +| _ < $@ +| |_) |$@ +|______/ $@ + $@@ + ______$@ + / |@ +| ,----'@ +| | $@ +| `----.@ + \______|@ + $@@ + _______ $@ +| \$@ +| .--. |@ +| | | |@ +| '--' |@ +|_______/$@ + $@@ + _______ @ +| ____|@ +| |__ $@ +| __| $@ +| |____ @ +|_______|@ + @@ + _______ @ +| ____|@ +| |__ $@ +| __| $@ +| | $ @ +|__| @ + @@ + _______ @ + / _____|@ +| | __ $@ +| | |_ |$@ +| |__| |$@ + \______|$@ + $@@ + __ __ $@ +| | | |$@ +| |__| |$@ +| __ |$@ +| | | |$@ +|__| |__|$@ + $@@ + __ $@ +| |$@ +| |$@ +| |$@ +| |$@ +|__|$@ + $@@ + __ $@ + | |$@ + | |$@ +.--. | |$@ +| `--' |$@ + \______/ $@ + $@@ + __ ___$@ +| |/ /$@ +| ' / $@ +| < $@ +| . \ $@ +|__|\__\$@ + $@@ + __ $@ +| | $@ +| | $@ +| | $@ +| `----.@ +|_______|@ + $@@ +.___ ___.$@ +| \/ |$@ +| \ / |$@ +| |\/| |$@ +| | | |$@ +|__| |__|$@ + $@@ +.__ __.$@ +| \ | |$@ +| \| |$@ +| . ` |$@ +| |\ |$@ +|__| \__|$@ + $@@ + ______ $@ + / __ \ $@ +| | | |$@ +| | | |$@ +| `--' |$@ + \______/ $@ + $@@ +.______ $@ +| _ \ $@ +| |_) |$@ +| ___/ $@ +| | $ @ +| _| $ @ + $ @@ + ______ $ @ + / __ \ $ @ +| | | | $ @ +| | | | $ @ +| `--' '--. @ + \_____\_____\@ + $ @@ +.______ $ @ +| _ \ $ @ +| |_) | $ @ +| / $ @ +| |\ \----.@ +| _| `._____|@ + $@@ + _______.@ + / |@ + | (----`@ + \ \ $@ +.----) | $@ +|_______/ $@ + $@@ +.___________.@ +| |@ +`---| |----`@ + | | $ @ + | | $ @ + |__| $ @ + $ @@ + __ __ $@ +| | | |$@ +| | | |$@ +| | | |$@ +| `--' |$@ + \______/ $@ + $@@ +____ ____$@ +\ \ / /$@ + \ \/ /$ @ + \ /$ @ + \ /$ @ + \__/$ @ + $ @@ +____ __ ____$@ +\ \ / \ / /$@ + \ \/ \/ /$ @ + \ /$ @ + \ /\ /$ @ + \__/ \__/$ @ + $ @@ +___ ___$@ +\ \ / /$@ + \ V / $@ + > < $@ + / . \ $@ +/__/ \__\$@ + $@@ +____ ____$@ +\ \ / /$@ + \ \/ /$ @ + \_ _/$ @ + | |$ @ + |__|$ @ + $ @@ + ________ $@ +| / $@ +`---/ / $@ + / / $@ + / /----.@ + /________|@ + $@@ + ____ @ +| |@ +| |-`@ +| | $@ +| | $@ +| |-.@ +|____|@@ +___ @ +\ \ $ @ + \ \$ @ + \ \$ @ + \ \$@ + \__\@ + @@ + ____ @ +| |@ +`-| |@ + | |@ + | |@ +.-| |@ +|____|@@ + ___ @ + / \ @ +/--^--\@ + $@ + $@ + $@ + $@@ + @ + @ + @ + $ @ + $ @ + ______ @ +|______|@@ + __ @ +( _)@ + \| @ + $ @ + $ @ + $ @ + @@ + ___ $ @ + / \ $ @ + / ^ \$ @ + / /_\ \$ @ + / _____ \$ @ +/__/ \__\$@ + $@@ +.______ $@ +| _ \ $@ +| |_) |$@ +| _ < $@ +| |_) |$@ +|______/ $@ + $@@ + ______$@ + / |@ +| ,----'@ +| | $@ +| `----.@ + \______|@ + $@@ + _______ $@ +| \$@ +| .--. |@ +| | | |@ +| '--' |@ +|_______/$@ + $@@ + _______ @ +| ____|@ +| |__ $@ +| __| $@ +| |____ @ +|_______|@ + @@ + _______ @ +| ____|@ +| |__ $@ +| __| $@ +| | $ @ +|__| @ + @@ + _______ @ + / _____|@ +| | __ $@ +| | |_ |$@ +| |__| |$@ + \______|$@ + $@@ + __ __ $@ +| | | |$@ +| |__| |$@ +| __ |$@ +| | | |$@ +|__| |__|$@ + $@@ + __ $@ +| |$@ +| |$@ +| |$@ +| |$@ +|__|$@ + $@@ + __ $@ + | |$@ + | |$@ +.--. | |$@ +| `--' |$@ + \______/ $@ + $@@ + __ ___$@ +| |/ /$@ +| ' / $@ +| < $@ +| . \ $@ +|__|\__\$@ + $@@ + __ $@ +| | $@ +| | $@ +| | $@ +| `----.@ +|_______|@ + $@@ +.___ ___.$@ +| \/ |$@ +| \ / |$@ +| |\/| |$@ +| | | |$@ +|__| |__|$@ + $@@ +.__ __.$@ +| \ | |$@ +| \| |$@ +| . ` |$@ +| |\ |$@ +|__| \__|$@ + $@@ + ______ $@ + / __ \ $@ +| | | |$@ +| | | |$@ +| `--' |$@ + \______/ $@ + $@@ +.______ $@ +| _ \ $@ +| |_) |$@ +| ___/ $@ +| | $ @ +| _| $ @ + $ @@ + ______ $ @ + / __ \ $ @ +| | | | $ @ +| | | | $ @ +| `--' '--. @ + \_____\_____\@ + $ @@ +.______ $ @ +| _ \ $ @ +| |_) | $ @ +| / $ @ +| |\ \----.@ +| _| `._____|@ + $@@ + _______.@ + / |@ + | (----`@ + \ \ $@ +.----) | $@ +|_______/ $@ + $@@ +.___________.@ +| |@ +`---| |----`@ + | | $ @ + | | $ @ + |__| $ @ + $ @@ + __ __ $@ +| | | |$@ +| | | |$@ +| | | |$@ +| `--' |$@ + \______/ $@ + $@@ +____ ____$@ +\ \ / /$@ + \ \/ /$ @ + \ /$ @ + \ /$ @ + \__/$ @ + $ @@ +____ __ ____$@ +\ \ / \ / /$@ + \ \/ \/ /$ @ + \ /$ @ + \ /\ /$ @ + \__/ \__/$ @ + $ @@ +___ ___$@ +\ \ / /$@ + \ V / $@ + > < $@ + / . \ $@ +/__/ \__\$@ + $@@ +____ ____$@ +\ \ / /$@ + \ \/ /$ @ + \_ _/$ @ + | |$ @ + |__|$ @ + $ @@ + ________ $@ +| / $@ +`---/ / $@ + / / $@ + / /----.@ + /________|@ + $@@ + ___@ + / /@ + | |$@ +/ /$ @ +\ \$ @ + | |$@ + \__\@@ + __ $@ +| |$@ +| |$@ +| |$@ +| |$@ +| |$@ +|__|$@@ +___ @ +\ \$ @ + | | @ + \ \@ + / /@ + | | @ +/__/$ @@ + __ _ @ + / \/ |@ +|_/\__/ @ + $ @ + $ @ + $ @ + @@ + _ _ @ + (_)_(_) @ + / \ @ + / _ \ @ + / ___ \ @ +/_/ \_\@ + @@ + _ _ @ +(_)_(_)@ + / _ \ @ +| | | |@ +| |_| |@ + \___/ @ + @@ + _ _ @ +(_) (_)@ +| | | |@ +| | | |@ +| |_| |@ + \___/ @ + @@ + _ _ @ +(_) (_)@ + __ _ @ + / _` |@ +| (_| |@ + \__,_|@ + @@ + _ _ @ +(_) (_)@ + ___ @ + / _ \ @ +| (_) |@ + \___/ @ + @@ + _ _ @ +(_) (_)@ + _ _ @ +| | | |@ +| |_| |@ + \__,_|@ + @@ + ___ @ + / _ \ @ +| | ) |@ +| |< < @ +| | ) |@ +| ||_/ @ +|_| @@ diff --git a/src/config.rs b/src/config.rs new file mode 100644 index 0000000..aa5790c --- /dev/null +++ b/src/config.rs @@ -0,0 +1,179 @@ +//! Carga las opciones de configuración. +//! +//! Estos ajustes se obtienen de archivos [TOML](https://toml.io) como pares `clave = valor` que se +//! mapean a estructuras **fuertemente tipadas** y valores predefinidos. +//! +//! Siguiendo la metodología [Twelve-Factor App](https://12factor.net/config), `PageTop` separa el +//! **código** de la **configuración**, lo que permite tener configuraciones diferentes para cada +//! despliegue, como *dev*, *staging* o *production*, sin modificar el código fuente. +//! +//! +//! # Orden de carga +//! +//! Si tu aplicación necesita archivos de configuración, crea un directorio `config` en la raíz del +//! proyecto, al mismo nivel que el archivo *Cargo.toml* o que el binario de la aplicación. +//! +//! `PageTop` carga en este orden, y siempre de forma opcional, los siguientes archivos TOML: +//! +//! 1. **config/common.toml**, para ajustes comunes a todos los entornos. Este enfoque simplifica el +//! mantenimiento al centralizar los valores de configuración comunes. +//! +//! 2. **config/{rm}.toml**, donde `{rm}` es el valor de la variable de entorno `PAGETOP_RUN_MODE`: +//! +//! * Si `PAGETOP_RUN_MODE` no está definida, se asume el valor `default`, y `PageTop` intentará +//! cargar *config/default.toml* si el archivo existe. +//! +//! * Útil para definir configuraciones específicas por entorno, garantizando que cada uno (p.e. +//! *dev*, *staging* o *production*) disponga de sus propias opciones, como claves de API, +//! URLs o ajustes de rendimiento, sin afectar a los demás. +//! +//! 3. **config/local.{rm}.toml**, útil para configuraciones locales específicas de la máquina o de +//! la ejecución: +//! +//! * Permite añadir o sobrescribir ajustes propios del entorno. Por ejemplo, `local.dev.toml` +//! para desarrollo o `local.production.toml` para retoques en producción. +//! +//! * Facilita que cada desarrollador adapte la configuración a su equipo en un entorno dado. Por +//! lo general no se comparte ni se sube al sistema de control de versiones. +//! +//! 4. **config/local.toml**, para ajustes locales válidos en cualquier entorno, ideal para cambios +//! rápidos o valores temporales que no dependan de un entorno concreto. +//! +//! Los archivos se combinan en el orden anterior, cada archivo sobrescribe a los anteriores en caso +//! de conflicto. +//! +//! +//! # Cómo añadir opciones de configuración a tu código +//! +//! Añade [*serde*](https://docs.rs/serde) en tu archivo *Cargo.toml* con la *feature* `derive`: +//! +//! ```toml +//! [dependencies] +//! serde = { version = "1.0", features = ["derive"] } +//! ``` +//! +//! Y usa la macro [`include_config!`](crate::include_config) para inicializar tus ajustes en una +//! estructura con tipos seguros. Por ejemplo: +//! +//! ```rust#ignore +//! use pagetop::prelude::*; +//! use serde::Deserialize; +//! +//! include_config!(SETTINGS: Settings => [ +//! // [myapp] +//! "myapp.name" => "Value Name", +//! "myapp.width" => 900, +//! "myapp.height" => 320, +//! ]); +//! +//! #[derive(Debug, Deserialize)] +//! pub struct Settings { +//! pub myapp: MyApp, +//! } +//! +//! #[derive(Debug, Deserialize)] +//! pub struct MyApp { +//! pub name: String, +//! pub description: Option, +//! pub width: u16, +//! pub height: u16, +//! } +//! ``` +//! +//! De esta forma estás añadiendo una nueva sección `[myapp]` a la configuración, igual que existen +//! `[app]` o `[server]` en las opciones globales de [`Settings`](crate::global::Settings). +//! +//! Se recomienda proporcionar siempre valores por defecto o usar `Option` para los ajustes +//! opcionales. +//! +//! Si la configuración no se inicializa correctamente, la aplicación lanzará *panic* y detendrá la +//! ejecución. +//! +//! Las estructuras de configuración son de **sólo lectura** durante la ejecución. +//! +//! +//! # Usando tus opciones de configuración +//! +//! ```rust#ignore +//! use pagetop::prelude::*; +//! use crate::config; +//! +//! fn global_settings() { +//! println!("Nombre de la app: {}", &global::SETTINGS.app.name); +//! println!("Descripción: {}", &global::SETTINGS.app.description); +//! println!("Run mode: {}", &global::SETTINGS.app.run_mode); +//! } +//! +//! fn extension_settings() { +//! println!("{} - {:?}", &config::SETTINGS.myapp.name, &config::SETTINGS.myapp.description); +//! println!("{}", &config::SETTINGS.myapp.width); +//! } +//! ``` + +use config::builder::DefaultState; +use config::{Config, ConfigBuilder, File}; + +use std::env; +use std::path::{Path, PathBuf}; +use std::sync::LazyLock; + +// Nombre del directorio de configuración por defecto. +const DEFAULT_CONFIG_DIR: &str = "config"; + +// Modo de ejecución por defecto. +const DEFAULT_RUN_MODE: &str = "default"; + +/// Valores originales cargados desde los archivos de configuración como pares `clave = valor`. +pub static CONFIG_VALUES: LazyLock> = LazyLock::new(|| { + // Determina el directorio de configuración: + // - Usa CONFIG_DIR si está definido en el entorno (p.e.: CONFIG_DIR=/etc/myapp ./myapp). + // - Si no, intenta DEFAULT_CONFIG_DIR dentro del proyecto (en CARGO_MANIFEST_DIR). + // - Si nada de esto aplica, entonces usa DEFAULT_CONFIG_DIR relativo al ejecutable. + let config_dir: PathBuf = if let Ok(env_dir) = env::var("CONFIG_DIR") { + env_dir.into() + } else if let Ok(manifest_dir) = env::var("CARGO_MANIFEST_DIR") { + let manifest_config = Path::new(&manifest_dir).join(DEFAULT_CONFIG_DIR); + if manifest_config.exists() { + manifest_config + } else { + DEFAULT_CONFIG_DIR.into() + } + } else { + DEFAULT_CONFIG_DIR.into() + }; + + // Determina el modo de ejecución según la variable de entorno PAGETOP_RUN_MODE. Por defecto usa + // DEFAULT_RUN_MODE si no está definida (p.e.: PAGETOP_RUN_MODE=production ./myapp). + let rm = env::var("PAGETOP_RUN_MODE").unwrap_or_else(|_| DEFAULT_RUN_MODE.into()); + + Config::builder() + // 1. Configuración común para todos los entornos (common.toml). + .add_source(File::from(config_dir.join("common.toml")).required(false)) + // 2. Configuración específica del entorno (p.e.: default.toml, production.toml). + .add_source(File::from(config_dir.join(format!("{rm}.toml"))).required(false)) + // 3. Configuración local reservada para cada entorno (p.e.: local.default.toml). + .add_source(File::from(config_dir.join(format!("local.{rm}.toml"))).required(false)) + // 4. Configuración local común (local.toml). + .add_source(File::from(config_dir.join("local.toml")).required(false)) + // Guarda el modo de ejecución explícitamente. + .set_override("app.run_mode", rm) + .expect("Failed to set application run mode") +}); + +#[macro_export] +macro_rules! include_config { + ( $SETTINGS:ident : $Settings:ty => [ $( $key:expr => $value:expr ),* $(,)? ] ) => { + /// Valores asignados o predefinidos para la configuración de [`$Settings`]. + pub static $SETTINGS: std::sync::LazyLock<$Settings> = std::sync::LazyLock::new(|| { + let mut settings = $crate::config::CONFIG_VALUES.clone(); + $( + settings = settings.set_default($key, $value).unwrap(); + )* + settings + .build() + .expect(concat!("Failed to build config for ", stringify!($Settings))) + .try_deserialize::<$Settings>() + .expect(concat!("Error parsing settings for ", stringify!($Settings))) + }); + }; +} diff --git a/src/global.rs b/src/global.rs new file mode 100644 index 0000000..5e3d52f --- /dev/null +++ b/src/global.rs @@ -0,0 +1,57 @@ +//! Opciones de configuración globales. + +use crate::include_config; + +use serde::Deserialize; + +include_config!(SETTINGS: Settings => [ + // [app] + "app.name" => "Sample", + "app.description" => "Developed with the amazing PageTop framework.", + "app.startup_banner" => "Slant", + + // [server] + "server.bind_address" => "localhost", + "server.bind_port" => 8080, +]); + +#[derive(Debug, Deserialize)] +/// Ajustes de configuración para las secciones globales [`[app]`](App) y [`[server]`](Server). +/// Consulta [`SETTINGS`] para los valores por defecto. +pub struct Settings { + pub app: App, + pub server: Server, +} + +#[derive(Debug, Deserialize)] +/// Sección `[app]` de la configuración. +/// +/// Forma parte de [`Settings`]. +pub struct App { + /// Nombre de la aplicación. + /// Valor por defecto: *"Sample"*. + pub name: String, + /// Breve descripción de la aplicación. + /// Valor por defecto: *"Developed with the amazing PageTop framework."*. + pub description: String, + /// ASCII banner printed at startup: *"Off"*, *"Slant"*, *"Small"*, *"Speed"*, or *"Starwars"*. + /// Default: *"Slant"*. + pub startup_banner: String, + /// Modo de ejecución. + /// Valor por defecto: el definido por la variable de entorno + /// `PAGETOP_RUN_MODE`, o *"default"* si no está establecida. + pub run_mode: String, +} + +#[derive(Debug, Deserialize)] +/// Sección `[server]` de la configuración. +/// +/// Forma parte de [`Settings`]. +pub struct Server { + /// Dirección de enlace para el servidor web. + /// Valor por defecto: *"localhost"*. + pub bind_address: String, + /// Puerto de escucha del servidor web. + /// Valor por defecto: *8088*. + pub bind_port: u16, +} diff --git a/src/lib.rs b/src/lib.rs index c18003f..82f9eba 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -36,6 +36,10 @@ pub use pagetop_macros::{main, test}; // API ********************************************************************************************* +// Carga las opciones de configuración. +pub mod config; +// Opciones de configuración globales. +pub mod global; // Gestión del servidor y servicios web. pub mod service; // Prepara y ejecuta la aplicación. diff --git a/src/prelude.rs b/src/prelude.rs index d35e9b1..bee222e 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -4,8 +4,15 @@ pub use crate::{main, test}; +// MACROS. + +// crate::config +pub use crate::include_config; + // API. +pub use crate::global; + pub use crate::service; pub use crate::app::Application; diff --git a/tests/config.rs b/tests/config.rs new file mode 100644 index 0000000..ff7135c --- /dev/null +++ b/tests/config.rs @@ -0,0 +1,41 @@ +use pagetop::prelude::*; + +use serde::Deserialize; + +use std::env; + +include_config!(SETTINGS: Settings => [ + "test.string_value" => "Test String", + "test.int_value" => -321, + "test.float_value" => 2.3456, +]); + +#[derive(Debug, Deserialize)] +pub struct Settings { + pub test: Test, +} + +#[derive(Debug, Deserialize)] +pub struct Test { + pub string_value: String, + pub int_value: i32, + pub float_value: f32, +} + +#[pagetop::test] +async fn check_global_config() { + env::set_var("PAGETOP_RUN_MODE", "test"); + + assert_eq!(global::SETTINGS.app.run_mode, "test"); + assert_eq!(global::SETTINGS.app.name, "Testing"); + assert_eq!(global::SETTINGS.server.bind_port, 9000); +} + +#[pagetop::test] +async fn check_local_config() { + env::set_var("PAGETOP_RUN_MODE", "test"); + + assert_eq!(SETTINGS.test.string_value, "Modified value"); + assert_eq!(SETTINGS.test.int_value, -321); + assert_eq!(SETTINGS.test.float_value, 8.7654); +}