banner

package module
Version: v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2020 License: Apache-2.0, MIT Imports: 1 Imported by: 8

README

banner

😄 ultra lightweight ascii-art generator

CI go.dev reference License GitHub release Go Report Card CodeFactor codecov GolangCI Made by Manfred Touron

Pure-go library to generate ASCII-art banners from text.

  • doesn't need any external dependencies
  • very lightweight footprint at the end in the generated binary
    • ~38kb with default build options
    • ~12kb with upx + binary strip
  • only one font available (small.flf)
    • incomplete alphabet (a-zA-Z.-_?)

Usage

import "moul.io/banner"

fmt.Println(banner.Inline("hey world."))
 _                                    _     _
| |_   ___  _  _   __ __ __ ___  _ _ | | __| |
| ' \ / -_)| || |  \ V  V // _ \| '_|| |/ _` | _
|_||_|\___| \_, |   \_/\_/ \___/|_|  |_|\__,_|(_)
            |__/

Install

Using go
$ go get -u moul.io/banner
Releases

See https://github.com/moul/banner/releases

License

© 2020 Manfred Touron

Licensed under the Apache License, Version 2.0 (LICENSE-APACHE) or the MIT license (LICENSE-MIT), at your option. See the COPYRIGHT file for more details.

SPDX-License-Identifier: (Apache-2.0 OR MIT)

Documentation

Overview

message from the author:

+--------------------------------------------------------------+
| * * * ░░░░░░░░░░░░░░░░░░░░  Hello  ░░░░░░░░░░░░░░░░░░░░░░░░░░|
+--------------------------------------------------------------+
|                                                              |
|     ++              ______________________________________   |
|     ++++           /                                      \  |
|      ++++          |                                      |  |
|    ++++++++++      |   Feel free to contribute to this    |  |
|   +++       |      |       project or contact me on       |  |
|   ++         |     |    manfred.life if you like this     |  |
|   +  -==   ==|     |               project!               |  |
|  (   <*>   <*>     |                                      |  |
|   |          |    /|                  :)                  |  |
|   |         _)   / |                                      |  |
|   |      +++    /  \______________________________________/  |
|    \      =+   /                                             |
|     \      +                                                 |
|     |\++++++                                                 |
|     |  ++++      ||//                                        |
|  ___|   |___    _||/__                                     __|
| /    ---    \   \|  |||                   __ _  ___  __ __/ /|
|/  |       |  \    \ /                    /  ' \/ _ \/ // / / |
||  |       |  |    | |                   /_/_/_/\___/\_,_/_/  |
+--------------------------------------------------------------+

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inline

func Inline(input string) string
Example
package main

import (
	"fmt"

	"moul.io/banner"
)

func main() {
	fmt.Println("start of banner")
	fmt.Println(banner.Inline("hey world."))
	fmt.Println("end of banner")
}
Output:

start of banner
 _                                    _     _
| |_   ___  _  _   __ __ __ ___  _ _ | | __| |
| ' \ / -_)| || |  \ V  V // _ \| '_|| |/ _` | _
|_||_|\___| \_, |   \_/\_/ \___/|_|  |_|\__,_|(_)
            |__/
end of banner

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL