SHML - 终端的样式框架(Shell Markup Language)

网友投稿 938 2022-10-22

SHML - 终端的样式框架(Shell Markup Language)

SHML - 终端的样式框架(Shell Markup Language)

SHML v.1.1.0

SHML is a shell framework for faster and easier script development.

Why

HTML has CSS, terminals have "ANSI/VT100 Control Sequences". SHML makes is easy to apply some style to your shell scripts without trying to remember that Yellow = \033[33m instead Yellow is $(color yellow).

1-liner Install

# Unix-like$ sudo bash -c 'curl -L https://raw.githubusercontent.com/odb/shml/1.1.0/shml.sh -o /usr/local/bin/shml && chmod +x /usr/local/bin/shml'# Homebrew$ brew install shml# npm$ npm install -g shml

Download

You can just download SHML without installing it...

Git

$ git clone https://github.com/odb/shml.git

wget

$ wget https://raw.githubusercontent.com/odb/shml/master/shml.sh

Sourcing

In order to use SHML you must tell your shell environment where it is located. Lets assume that we are writing a BASH script and want to use SHML.

If you installed in using the 1-liner above you would do:

#!/usr/bin/env bashsource $(which shml)

If you downloaded SHML using git or wget you would do:

#!/usr/bin/env bashsource ./shml.sh

Examples

#!/usr/bin/env bashsource "$(which shml)"echo "$(fgcolor red)This will make the text red...$(fgcolor end)"

View all examples: https://odb.github.io/shml/getting-started/

Contributing

Contributions are more than welcome. Before submitting ANY new features please read the Contribution Guidelines.

To report any bugs or if you have a feature request feel free to open an issue.

Updating The Docs

Updating the docs requires Ruby/Jekyll to generate & view locally.

Run once:

$ cd docs/$ gem install bundler$ bundle install

Generate and serve:

$ bundle exec jekyll s --watch

Then go to: http://localhost:4000/shml/

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:hdu2647 N!Again
下一篇:基于SAEJ1939无线通信数传协议的CAN(控制器局域网络)总线批量数据传输
相关文章

 发表评论

暂时没有评论,来抢沙发吧~