mirror of
https://github.com/kennethreitz-archive/kHTML.tmbundle.git
synced 2026-06-21 16:10:56 +00:00
36 lines
1003 B
Plaintext
Executable File
36 lines
1003 B
Plaintext
Executable File
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>beforeRunningCommand</key>
|
|
<string>nop</string>
|
|
<key>command</key>
|
|
<string>#!/usr/bin/env ruby
|
|
table = STDIN.readlines
|
|
table = table.collect { |row| row.gsub(/\n/, '').split(/\t+/) }
|
|
puts "<table>"
|
|
table.each_with_index do |row, index|
|
|
print "\t<tr>"
|
|
if index == 0
|
|
row.each { |cell| print "<th>#{cell}</th>" }
|
|
else
|
|
row.each { |cell| print "<td>#{cell}</td>" }
|
|
end
|
|
print "</tr>\n"
|
|
end
|
|
puts "</table>"</string>
|
|
<key>input</key>
|
|
<string>selection</string>
|
|
<key>keyEquivalent</key>
|
|
<string>^~@T</string>
|
|
<key>name</key>
|
|
<string>tabs -> table (th top)</string>
|
|
<key>output</key>
|
|
<string>replaceSelectedText</string>
|
|
<key>scope</key>
|
|
<string>text.html</string>
|
|
<key>uuid</key>
|
|
<string>479101F9-D223-422E-927D-97E97BAC326F</string>
|
|
</dict>
|
|
</plist>
|