Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

コンソールで高度な色付けを行えるようにしたい

#12

コンソールで高度な色付けを行えるようにしたいです。 要は、色の指定を入れ子にできるようにしたい。 簡易マークアップ言語みたいなのを渡すとそれをパースして出力用の文字列にしてくれるようなイメージで考えてます。 例えば以下の感じ。


text = ConsoleString.new('<red>aaa<blue>bb</blue>aaaa</red>')
print text  #=> "\e[31maaa\e[34mbb\e[31maaaa\e[0m"

これが実現すると検索ワードの色付け等がうまく行えるようになります。

Reported by jugyo · January 17th, 2009 @ 08:36 AM

State: resolved
Milestone: none
Assigned to: jugyo jugyo

Activity

  1. jugyo
    jugyo
    • Assigned user set to jugyo

    termcolor というライブラリを作ったのでそれを使うようにする予定。

    http://rubyforge.org/projects/te...

    February 27th, 2009 @ 10:22 AM

  2. jugyo
    jugyo
    • State changed from new to resolved

    でけた

    March 11th, 2009 @ 10:13 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.