Skip to content

Instantly share code, notes, and snippets.

@noqisofon
Created November 24, 2010 06:41
Show Gist options
  • Save noqisofon/713220 to your computer and use it in GitHub Desktop.
Save noqisofon/713220 to your computer and use it in GitHub Desktop.
emacs color を html で見れるようにするスクリプト。
# -*- encoding: shift_jis -*-
require 'yaml'
colors_book = File.open( "emacs-color.yml", "r" ) { |output| YAML.load( output ) }
File.open( "emacs-color.html", "w" ) do |input|
input.puts "<table style=\"width: 100%;\">"
input.puts " <tbody>"
colors_book.each do |k, v|
input.puts " <tr style=\"font-family: 'tahoma'; height: 5em;\">"
input.print " <td style=\"width: 10%;\">#{k}</td>"
input.print " <td style=\"width: *; background-color: #{v};\"></td>"
input.puts " </tr>"
end
input.puts " </tbody>"
input.puts "</table>"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment