Qalam - An easy to use terminal styling library

Qalam ✏️

Qalam is a Go library for easy terminal styling. Example for what qalam can do

Installation

go get github.com/iskaa02/qalam

Usage

func main(){
	// this will output "a red text" with red in terminal
	// you can use qalam.Sprintf() if you don't want to print yet
	qalam.Printf("[red]a red %s[/red]","text")
}
Code Style
b/bold bold text
i/italic italic text
u/underline underline text
s/strikethrough strikethrough text
#hexcode change the color
bg#hexcode change the background color
red change the color to red
yellow change the color to yellow
magenta change the color to magenta
white change the color to white
black change the color to black
green change the color to green
cyan change the color to cyan
bg.(color) change the background color to any color mentioned above

Examples

Multiple styles

qalam.Printf("[b s]bold and strikethrough[/b s]")

outputs: bold and strikethrough

Composing styles

qalam.Printf("[b]bold only [i]bold and italic[/i][/b]")

outputs: bold only bold and italic

Emoji

// outputs "this is a vampire -> 🧛"
qalam.Printf("this is a vampire ->[:vampire:]")

Style

You can use style function to apply style to string

// this is equivalent for qalam.Sprintf("[bold]this text is bold[/bold]") 
qalam.Style("this text is bold","bold")

Emoji

You can use get emoji function to return an emoji

// returns '🍎'
qalam.Emoji("red_apple")

What does the Qalam mean

Qalam in Arabic means pencil

Compatibility

ANSI work a bit different depending on the operating system, this implementation should work for MacOS, Linux and Windows, Although it's only been tested on Linux.

Similar Resources

An easy to use go program to download videos from Reddit

Gedditsave Download videos from reddit from the command line. Use guide geddit -

Oct 17, 2022

An easy to use go program to download videos from Reddit.

An easy to use go program to download videos from Reddit.

Gettit Download videos from reddit from the command line. Use guide gettit -u post_url Example : gettit -u https://www.reddit.com/r/programminghorror/

Dec 30, 2022

The simple and easy-to-use program designed to watch user activity for Cloud Providers.

Cloud Agent The simple and easy-to-use program is designed to watch user activity and possible orphan clusters for Cloud Providers: Gardener GCP (work

Jun 6, 2022

A UI library for terminal applications.

A UI library for terminal applications.

tui: Terminal UI for Go A UI library for terminal applications. tui (pronounced tooey) provides a higher-level programming model for building rich ter

Jan 6, 2023

Terminal UI library with rich, interactive widgets — written in Golang

Terminal UI library with rich, interactive widgets — written in Golang

Rich Interactive Widgets for Terminal UIs This Go package provides commonly needed components for terminal based user interfaces. Among these componen

Jan 7, 2023

🎨 Terminal color rendering library, support 8/16 colors, 256 colors, RGB color rendering output, support Print/Sprintf methods, compatible with Windows.

🎨 Terminal color rendering library, support 8/16 colors, 256 colors, RGB color rendering output, support Print/Sprintf methods, compatible with Windows.

🎨 Terminal color rendering library, support 8/16 colors, 256 colors, RGB color rendering output, support Print/Sprintf methods, compatible with Windows. GO CLI 控制台颜色渲染工具库,支持16色,256色,RGB色彩渲染输出,使用类似于 Print/Sprintf,兼容并支持 Windows 环境的色彩渲染

Dec 30, 2022

A Go library for terminal background color detection

go-termbg A Go library for terminal background color detection. The detected color is provided by RGB or theme ( dark or light ). Based on https://git

Jan 4, 2022

A very simple library for interactively selecting an option on a terminal

A very simple library for interactively selecting an option on a terminal

go-choice A very simple library for interactively selecting an option on a terminal Usage package main import ( "fmt" "github.com/TwiN/go-ch

Dec 30, 2021

Library for easy named formatting strings

go-celsium Library for easy named formatting translations Documentation All translations with named parameters are stored in next format: Hello, {name

Apr 12, 2021
Stonks is a terminal based stock visualizer and tracker that displays realtime stocks in graph format in a terminal.
Stonks is a terminal based stock visualizer and tracker that displays realtime stocks in graph format in a terminal.

Stonks is a terminal based stock visualizer and tracker. Installation Requirements: golang >= 1.13 Manual Clone the repo Run make && make install Pack

Dec 16, 2022
ghcv-cli makes it easy to view the user-created issues, pull requests, and repositories in the terminal.
ghcv-cli makes it easy to view the user-created issues, pull requests, and repositories in the terminal.

ghcv-cli ghcv-cli makes it easy to view the user-created issues, pull requests, and repositories in the terminal. About Show a list of pull requests c

Mar 13, 2022
A wrapper around cd and xdg-open to use aliases to directory paths in terminal

CDD - Change directories Dynamically I am a lazy linux user and turns out that basic tab completion wasn't enough for me to navigate through my direct

Dec 15, 2022
A terminal designed for anyone to use and designed for any platform

A terminal designed for anyone to use and designed for any platform. Which includes the basic features of any terminal and includes friendly commands to perform tools such as ping, traceroute, generate key pairs, encrypt/decrypt, router security actions, etc. All of the source code is done in Go.

Jan 25, 2022
A very simple note-taking CLI you can use from the terminal that uses a SQLite DB to persist, and query, notes.

Note Logger Summary A very simple note-taking CLI you can use from the terminal that uses a SQLite DB to persist, and query, notes. Building/Installin

Apr 14, 2022
An easy to use menu structure for cli applications that prompts users to make choices.
An easy to use menu structure for cli applications that prompts users to make choices.

WMenu Package wmenu creates menus for cli programs. It uses wlog for its interface with the command line. It uses os.Stdin, os.Stdout, and os.Stderr w

Dec 26, 2022
Simple and easy to use command line application written in Go for cleaning unnecessary XCode files.

xcclear Say hello to a few extra gigabytes of space on your Mac with xcclear, a simple and easy to use command line application written in Go for clea

Dec 16, 2022
An easy-to-use cli tool for downloading manga
An easy-to-use cli tool for downloading manga

mangodl Download and search manga right from the terminal! Report Bug || Request Feature Table of Contents About the Project Built With Getting Starte

Nov 26, 2022
Easy to use CLI for cryptography

EDH (Encryption, Decryption, Hashing) Utility that aims to improve efficiency of encryption, decryption and hashing by making a simple to use CLI Writ

Nov 4, 2021
Simple, lightweight, and easy to use gopacket wrapper cli

gniffer Simple, lightweight, and easy to use gopacket wrapper cli Explore the docs » View Demo · Report Bug · Request Feature Table of Contents About

Dec 25, 2021