Skip to content

Commit

Permalink
Add new box designs 'info', 'warning', and 'critical'
Browse files Browse the repository at this point in the history
which take advantage of coloring and unicode
  • Loading branch information
tsjensen committed Oct 28, 2023
1 parent 20509e4 commit f96df36
Show file tree
Hide file tree
Showing 3 changed files with 179 additions and 1 deletion.
150 changes: 149 additions & 1 deletion boxes-config
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#
# ___________________________________________________________________________________________________________________
#
# Format: ASCII Text
# Character Encoding: UTF-8
# Syntax of this file: https://boxes.thomasjensen.com/config-syntax.html
#
#====================================================================================================================
Expand Down Expand Up @@ -3179,4 +3179,152 @@ END tux
# ============================================================================


BOX info

author "Thomas Jensen"
designer "Thomas Jensen"
revision "1.0"
created "2023-10-24"
tags "box, color, simple, unicode"

sample
▄▄ INFO ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ █
█ This is an informational message. █
█ Don't worry about it. █
█ █
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
ends

# Monochrome sample:
# ▄▄ INFO ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
# █ █
# █ This is an informational message. █
# █ Don't worry about it. █
# █ █
# ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

shapes {
nw ("▄")
nnw ("▄ INFO ")
n ("▄")
ne ("▄")
w ("█")
e ("█")
sw ("▀")
s ("▀")
se ("▀")
}

elastic (n, s, e, w)

padding {
horizontal 2
vertical 1
}

END info


# ============================================================================


BOX warning

author "Thomas Jensen"
designer "Thomas Jensen"
revision "1.0"
created "2023-10-24"
tags "box, color, simple, unicode"

sample
▄▄ WARNING ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ █
█ Sub-zero temperatures expected. █
█ Please drive carefully. █
█ █
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
ends

# Monochrome sample:
# ▄▄ WARNING ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
# █ █
# █ Sub-zero temperatures expected. █
# █ Please drive carefully. █
# █ █
# ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

shapes {
nw ("▄")
nnw ("▄ WARNING ")
n ("▄")
ne ("▄")
w ("█")
e ("█")
sw ("▀")
s ("▀")
se ("▀")
}

elastic (n, s, e, w)

padding {
horizontal 2
vertical 1
}

END warning


# ============================================================================


BOX critical

author "Thomas Jensen"
designer "Thomas Jensen"
revision "1.0"
created "2023-10-24"
tags "box, color, simple, unicode"

sample
▄▄ CRITICAL ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ █
█ Coolant levels below minimum. █
█ Disengage main drive and stop for repairs. █
█ █
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
ends

# Monochrome sample:
# ▄▄ CRITICAL ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
# █ █
# █ Coolant levels below minimum. █
# █ Disengage main drive and stop for repairs. █
# █ █
# ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

shapes {
nw ("▄")
nnw ("▄ CRITICAL ")
n ("▄")
ne ("▄")
w ("█")
e ("█")
sw ("▀")
s ("▀")
se ("▀")
}

elastic (n, s, e, w)

padding {
horizontal 2
vertical 1
}

END critical



#EOF vim: set ai sw=4 expandtab syn=boxes:
15 changes: 15 additions & 0 deletions test/184_create_box_colored_contents.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:DESC
Creates a unicode box which also colors its contents.

:ARGS
-d critical -i box
:INPUT
Aaargh, let go of me!
:OUTPUT-FILTER
:EXPECTED
▄▄ CRITICAL ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ █
█ Aaargh, let go of me! █
█ █
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
:EOF
15 changes: 15 additions & 0 deletions test/185_remove_box_uncolor_contents.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:DESC
Removes a unicode box which had colored its contents, restoring the original monochrome text.

:ARGS
-r
:INPUT
▄▀ CRITICAL ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ █
█ Aaargh, let go of me! █
█ █
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
:OUTPUT-FILTER
:EXPECTED
Aaargh, let go of me!
:EOF

0 comments on commit f96df36

Please sign in to comment.