GithubHelp home page GithubHelp logo

odb / shml Goto Github PK

View Code? Open in Web Editor NEW
441.0 11.0 14.0 636 KB

SHell Markup Language | Style Framework for The Terminal

Home Page: http://shml.xyz

License: MIT License

Makefile 5.03% Shell 94.97%
shell bash bash-script ansi-colors emojis icons shml

shml's Introduction

SHML by ODB

SHML v.1.1.0

Build Status

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 bash
source $(which shml)

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

#!/usr/bin/env bash
source ./shml.sh

Examples

#!/usr/bin/env bash
source "$(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/

shml's People

Contributors

habbie avatar jdorfman avatar jimaek avatar jmervine avatar mandihamza avatar trumbitta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shml's Issues

Remove Runnable Demo links

Runnable got acquired and shut down the service.

image

Need to remove the "Demo on Runnable" images in docs and README

cloudapp annotation 2017-12-23 at 8 27 38 am png

Error when sourcing

Error Message

/usr/local/bin/shml:360: = not found

Line 358 - 365

# Usage / Examples
##
if [ "$0" == "$BASH_SOURCE" ]; then

if [[ $@ =~ .*-v.* ]]; then
  echo "shml version ${SHML_VERSION}"
  exit 0
fi

Add basic installer.

I'd like to add an installer modeled after the one used in odb/shunt. Not sure about the adding to path though, as this isn't technically an executable. If done, I'm thinking it could be sourced with:

source "$(which shml.sh)"

Feedback welcome.

Rework tests...

The current abstraction of tests tests.sh sourcing *_tests.sh files makes it harder to tell where the error is coming from. Tests need to be reworked.

Docs: Switch to Kramdown

Need to replace redcarpet with kramdown:

The page build completed successfully, but returned the following warning:

You are currently using the 'redcarpet' Markdown engine, which is no longer supported by GitHub Pages and may cease working at any time. To ensure your site continues to build, remove the 'markdown' setting in your site's '_config.yml' file and confirm your site renders as expected. For more information, see https://help.github.com/articles/updating-your-markdown-processor-to-kramdown/.

The problem is when we switch to Kramdown we have issues with rendering:

image

image

`confirm` function

Add confirm with usage like so:

# with success callback
on_succes() {
    echo "Success"
}
confirm "Did you succeed?" "on_success"

# with success and failure callbacks
on_failure() {
    echo "Failed"
}
confirm "Did you succeed?" "on_success" "on_failure"

# w/o callbacks
config "Did you succeed?" && echo "Why yes, yes I did!"

@jdorfman thoughts?

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.