Git Product home page Git Product logo

daveml's Introduction

DaveML

Adds color to linux files using simple markup.

For example, <WBB> for bold white text on a blue background. This becomes the ANSI color escape sequence: \x1b[37;44;1m.

Instead of this, you might want to try: bat, ccat, pygmentize, or highlight.

Example

Create a file demo.txt, such as:

<WBB>|             |
<WBB>|   Welcome   |
<WBB>|             |

<GXX>This is going to be <CXX>cool <RBX>!!!

And it will become:

screenshot

Usage

daveml.sh demo.txt
cat demo.txt | daveml.sh
cat <<EOF | daveml.sh -p ""
Usage: <BBX>some-command <YBX>arg1 arg2
EOF

The current default is to show a | line prefix. It can be removed or changed with -p:

daveml.sh -p "" /etc/motd
daveml.sh -p ">> " /etc/motd

Codes

Colors are specified as 3 letter tags, such as RXX for red text, or WBB for bold white with a blue background. CLR is used to clear/reset.

<foreground> <bold or X> <background or X>

K = black, R = red, G = green, Y = yellow, B = blue M = magenta, C = cyan, W = white, X = default

Notes

  • This does not currently include support for italic, _ underline _, or strikethrough.
  • This uses perl, but could be modified to use sed instead.
  • Remember, if you do a bold color before a non-bold, you'll need a CLR to remove the bold effect: <BBX>...<CLR><BXX>...

Install

To install globally:

sudo curl -sL -o /usr/local/bin/daveml.sh https://raw.githubusercontent.com/davehasagithub/daveml/main/daveml.sh
sudo chmod 755 /usr/local/bin/daveml.sh
sudo bash -c 'echo "alias daveml=\"/usr/local/bin/daveml.sh\"" >/etc/profile.d/daveml-alias.sh'
#sign out and back in for the alias to take effect

To use locally:

curl -sLO https://raw.githubusercontent.com/davehasagithub/daveml/main/daveml.sh
chmod u+x ./daveml.sh

daveml's People

Contributors

davehasagithub avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.