Project

shell2html

0.0
No commit activity in last 3 years
No release in over 3 years
A ruby lib for transforming bash colors into html. Parses escape chars and outputs html.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
 Project Readme

Shell2html

Gem Version Downloads Build Status Coverage Status Dependency Status Code Climate


A ruby lib for conversion between bash colors and HTML. It was created to help the Shellplay tool to export html from colored shell output.

Code is still experimental, use at your own risk. But "it works for me". An example of usage is visible on http://mose.com/20140814-dokku/

Installation

Add this line to your application's Gemfile:

gem 'shell2html'

And then execute:

$ bundle

Or install it yourself as:

$ gem install shell2html

Usage

require "shell2html"

puts Shell2html.to_html("\e[33m>\e[0m\e[1;31m some colored thing.\e[0m")

Commandline command

There is a command shell2html provided in this lib for commandline execution.

shell2html <file>
echo "\e[31mPrompt: \e[0m" | shell2html

The html is output in stdout.

Another command shell2css will print out the CSS associated with the generated html.

Use shell2css sass to generate a Sass version instead.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Copyright

(c) Copyright 2014-2015 mose. Distributed under MIT license