Commit b610d1cb03

b610d1cb03cdc3873d5eec3c0faeed51391d0e6e

parent: e0aadec964

Verified · cmc

cmc <hello@cleberg.net> · 2026-08-20 17:04 UTC

fix: clarify reason behind 79 char width, remove stray char, and fix order precedence

Layout: unified · split

content/blog/2026-08-20-nfogen.org +10 −10
@@ -270,9 +270,10 @@ rows and columns.
270** Width 270** Width
271 271
272The first issue I ran into was determining the width to use. I settled on 79 272The first issue I ran into was determining the width to use. I settled on 79
273characters, with border characters at both ends, because X. This means that my 273characters, with border characters at both ends, because 80-column terminals,
274script needs to perform some math to calculate wrapping, padding, and centering 274minus one so the line doesn't wrap when a terminal auto-wraps at exactly 80.
275of text throughout. 275This means that my script needs to perform some math to calculate wrapping,
276padding, and centering of text throughout.
276 277
277The math is relatively simple because CP437 is single-byte and single-width, 278The math is relatively simple because CP437 is single-byte and single-width,
278which means I can write functions that depend on that one-to-one correlation 279which means I can write functions that depend on that one-to-one correlation
@@ -328,7 +329,7 @@ If an explicity art file is defined, this generator does not run.
328 329
329#+begin_src python 330#+begin_src python
330# A compact 5-row block font for the banner generator. Each glyph is five 331# A compact 5-row block font for the banner generator. Each glyph is five
331# rows joined by "/". Uppercase letters, digits, space, and [<35;44;2Ma few symbols. 332# rows joined by "/". Uppercase letters, digits, space, and a few symbols.
332_FONT = { 333_FONT = {
333 "A": " ### /# #/#####/# #/# #", "B": "#### /# #/#### /# #/#### ", 334 "A": " ### /# #/#####/# #/# #", "B": "#### /# #/#### /# #/#### ",
334 "C": " ####/# /# /# / ####", "D": "#### /# #/# #/# #/#### ", 335 "C": " ####/# /# /# / ####", "D": "#### /# #/# #/# #/#### ",
@@ -351,12 +352,11 @@ def banner(text: str) -> str:
351Finally, I defined a specific order to the inputs. As stated in the README, the 352Finally, I defined a specific order to the inputs. As stated in the README, the
352order of importance is: =template < profile < config file < CLI flags < prompts=. 353order of importance is: =template < profile < config file < CLI flags < prompts=.
353 354
354This was an opinionated design choice, as I felt that if you were to create a 355This was an opinionated design choice, as I felt that if you were to run the
355template, that should take precedence above all. Then, profiles and 356script in interactive mode, that meant you wanted those to take precedence over
356configurations are additional preconfigured files that require effort to create 357all. Then again, specifying CLI flags directly when running the script should do
357and maintain, which earns them the next spots. Finally, the script falls back to 358the same. Finally, specifying configuration files, profiles, and templates will
358CLI arguments, if supplied, and then interactive prompt mode if nothing else 359take precedence in descending order.
359exists.
360 360
361* The Future 361* The Future
362 362