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.
270270** Width
271271
272272The 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
274script needs to perform some math to calculate wrapping, padding, and centering
275of text throughout.
273characters, with border characters at both ends, because 80-column terminals,
274minus one so the line doesn't wrap when a terminal auto-wraps at exactly 80.
275This means that my script needs to perform some math to calculate wrapping,
276padding, and centering of text throughout.
276277
277278The math is relatively simple because CP437 is single-byte and single-width,
278279which 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.
328329
329330#+begin_src python
330331# 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.
332333_FONT = {
333334 "A": " ### /# #/#####/# #/# #", "B": "#### /# #/#### /# #/#### ",
334335 "C": " ####/# /# /# / ####", "D": "#### /# #/# #/# #/#### ",
@@ -351,12 +352,11 @@ def banner(text: str) -> str:
351352Finally, I defined a specific order to the inputs. As stated in the README, the
352353order of importance is: =template < profile < config file < CLI flags < prompts=.
353354
354This was an opinionated design choice, as I felt that if you were to create a
355template, that should take precedence above all. Then, profiles and
356configurations are additional preconfigured files that require effort to create
357and maintain, which earns them the next spots. Finally, the script falls back to
358CLI arguments, if supplied, and then interactive prompt mode if nothing else
359exists.
355This was an opinionated design choice, as I felt that if you were to run the
356script in interactive mode, that meant you wanted those to take precedence over
357all. Then again, specifying CLI flags directly when running the script should do
358the same. Finally, specifying configuration files, profiles, and templates will
359take precedence in descending order.
360360
361361* The Future
362362