Skip to content

Commit

Permalink
Multiple banner sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
tecosaur committed May 18, 2023
1 parent 31b7a12 commit d0110af
Showing 1 changed file with 51 additions and 10 deletions.
61 changes: 51 additions & 10 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -438,16 +438,57 @@ function banner(io::IO = stdout)
doclink = S"{bold:Documentation:} {(underline=grey),link={https://docs.julialang.org}:https://docs.julialang.org}"
help = S"Type {region,julia_help_prompt:?} for help, {region,julia_pkg_prompt:]?} for {(underline=grey),link={https://pkgdocs.julialang.org/}:Pkg} help."

print(io, S"""
{bold,green:_}
{bold,blue:_} _ {bold:{red:_}{green:(_)}{magenta:_}} {shadow:│} $doclink
{bold,blue:(_)} | {bold:{red:(_)} {magenta:(_)}} {shadow:│}
_ _ _| |_ __ _ {shadow:│} $help
| | | | | | |/ _` | {shadow:│}
| | |_| | | | (_| | {shadow:│} Version {bold:$VERSION}$commit_date
_/ |\\__'_|_|_|\\__'_| {shadow:│} $commit_string
|__/ {shadow:│}
\n""")
if all(displaysize(io) .>= (20, 70)) # Full size
print(io, S"""
{bold,green:_}
{bold,blue:_} _ {bold:{red:_}{green:(_)}{magenta:_}} {shadow:│} $doclink
{bold,blue:(_)} | {bold:{red:(_)} {magenta:(_)}} {shadow:│}
_ _ _| |_ __ _ {shadow:│} $help
| | | | | | |/ _` | {shadow:│}
| | |_| | | | (_| | {shadow:│} Version {bold:$VERSION}$commit_date
_/ |\\__'_|_|_|\\__'_| {shadow:│} $commit_string
|__/ {shadow:│}
\n""")
elseif all(displaysize(io) .>= (15, 70)) # Shorter
print(io, S"""
{bold,green:_}
{bold,blue:_} _ {bold:{red:_}{green:(_)}{magenta:_}} {shadow:│} $doclink
{bold,blue:(_)} _ _ | |{bold:{red:(_)} {magenta:(_)}}_ {shadow:│} $help
| || || || || |/ _` | {shadow:│}
_/ | \\_._||_||_|\\__/_| {shadow:│} Version {bold:$VERSION}$commit_date
|__/ {shadow:│} $commit_string
\n""")
elseif all(displaysize(io) .>= (25, 45)) # Narrower
print(io, S"""
{bold,green:_}
{bold,blue:_} _ {bold:{red:_}{green:(_)}{magenta:_}}
{bold,blue:(_)} _ _ | |{bold:{red:(_)} {magenta:(_)}}_
| || || || || |/ _` |
_/ | \\_._||_||_|\\__/_|
|__/
$doclink
$help
Version {bold:$VERSION}$commit_date
$commit_string
\n""")
elseif all(displaysize(io) .>= (8, 55)) # Tiny
print(io, S"""
{bold,blue:o} ╷{green:∴} {shadow:│} $doclink
│╷ ╷││╭─┐ {shadow:│} Version {bold:$VERSION}$commit_date
│╰─┘╵╵╰─╰ {shadow:│} $commit_string
""")
elseif all(displaysize(io) .>= (5, 25)) # Tinier
print(io, S"""
{bold,blue:o} |{green:∴} _
||_|||(_|
╯{grey:{bold:$VERSION}$commit_date}
\n""")
else # Text only
print(io, S"""{bold:{blue:∴} {magenta:Julia} $VERSION}$commit_date\n""")
end
end

global active_repl
Expand Down

0 comments on commit d0110af

Please sign in to comment.