Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

173 lines (167 sloc) 8.736 kb
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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
#
# Lookup current word as a CSS property on w3c.org
#
# The mapping below was generated using:
# echo '$props = {'; curl -s http://www.w3.org/TR/CSS2/propidx.html|egrep "(^|&lt;tr&gt;&lt;td&gt;)&lt;a href=\".*\" class=\"noxref\"&gt;&lt;span class=\".*\"&gt;'.*'&lt;/span&gt;&lt;/a&gt;"|perl -pe "s|(?:&lt;tr&gt;&lt;td&gt;)?&lt;a href=\"(.*)\" class=\"noxref\"&gt;&lt;span class=\".*\"&gt;'(.*)'&lt;/span&gt;&lt;/a&gt;|\t\"\$2\"\t=&gt; \"\$1\",|"; echo '}'
$props = {
"azimuth" =&gt; "aural.html#propdef-azimuth",
"background" =&gt; "colors.html#propdef-background",
"background-attachment" =&gt; "colors.html#propdef-background-attachment",
"background-color" =&gt; "colors.html#propdef-background-color",
"background-image" =&gt; "colors.html#propdef-background-image",
"background-position" =&gt; "colors.html#propdef-background-position",
"background-repeat" =&gt; "colors.html#propdef-background-repeat",
"border" =&gt; "box.html#propdef-border",
"border-collapse" =&gt; "tables.html#propdef-border-collapse",
"border-color" =&gt; "box.html#propdef-border-color",
"border-spacing" =&gt; "tables.html#propdef-border-spacing",
"border-style" =&gt; "box.html#propdef-border-style",
"border-top" =&gt; "box.html#propdef-border-top",
"border-right" =&gt; "box.html#propdef-border-right",
"border-bottom" =&gt; "box.html#propdef-border-bottom",
"border-left" =&gt; "box.html#propdef-border-left",
"border-top-color" =&gt; "box.html#propdef-border-top-color",
"border-right-color" =&gt; "box.html#propdef-border-right-color",
"border-bottom-color" =&gt; "box.html#propdef-border-bottom-color",
"border-left-color" =&gt; "box.html#propdef-border-left-color",
"border-top-style" =&gt; "box.html#propdef-border-top-style",
"border-right-style" =&gt; "box.html#propdef-border-right-style",
"border-bottom-style" =&gt; "box.html#propdef-border-bottom-style",
"border-left-style" =&gt; "box.html#propdef-border-left-style",
"border-top-width" =&gt; "box.html#propdef-border-top-width",
"border-right-width" =&gt; "box.html#propdef-border-right-width",
"border-bottom-width" =&gt; "box.html#propdef-border-bottom-width",
"border-left-width" =&gt; "box.html#propdef-border-left-width",
"border-width" =&gt; "box.html#propdef-border-width",
"bottom" =&gt; "visuren.html#propdef-bottom",
"caption-side" =&gt; "tables.html#propdef-caption-side",
"clear" =&gt; "visuren.html#propdef-clear",
"clip" =&gt; "visufx.html#propdef-clip",
"color" =&gt; "colors.html#propdef-color",
"content" =&gt; "generate.html#propdef-content",
"counter-increment" =&gt; "generate.html#propdef-counter-increment",
"counter-reset" =&gt; "generate.html#propdef-counter-reset",
"cue" =&gt; "aural.html#propdef-cue",
"cue-after" =&gt; "aural.html#propdef-cue-after",
"cue-before" =&gt; "aural.html#propdef-cue-before",
"cursor" =&gt; "ui.html#propdef-cursor",
"direction" =&gt; "visuren.html#propdef-direction",
"display" =&gt; "visuren.html#propdef-display",
"elevation" =&gt; "aural.html#propdef-elevation",
"empty-cells" =&gt; "tables.html#propdef-empty-cells",
"float" =&gt; "visuren.html#propdef-float",
"font" =&gt; "fonts.html#propdef-font",
"font-family" =&gt; "fonts.html#propdef-font-family",
"font-size" =&gt; "fonts.html#propdef-font-size",
"font-size-adjust" =&gt; "fonts.html#propdef-font-size-adjust",
"font-stretch" =&gt; "fonts.html#propdef-font-stretch",
"font-style" =&gt; "fonts.html#propdef-font-style",
"font-variant" =&gt; "fonts.html#propdef-font-variant",
"font-weight" =&gt; "fonts.html#propdef-font-weight",
"height" =&gt; "visudet.html#propdef-height",
"left" =&gt; "visuren.html#propdef-left",
"letter-spacing" =&gt; "text.html#propdef-letter-spacing",
"line-height" =&gt; "visudet.html#propdef-line-height",
"list-style" =&gt; "generate.html#propdef-list-style",
"list-style-image" =&gt; "generate.html#propdef-list-style-image",
"list-style-position" =&gt; "generate.html#propdef-list-style-position",
"list-style-type" =&gt; "generate.html#propdef-list-style-type",
"margin" =&gt; "box.html#propdef-margin",
"margin-top" =&gt; "box.html#propdef-margin-top",
"margin-right" =&gt; "box.html#propdef-margin-right",
"margin-bottom" =&gt; "box.html#propdef-margin-bottom",
"margin-left" =&gt; "box.html#propdef-margin-left",
"marker-offset" =&gt; "generate.html#propdef-marker-offset",
"marks" =&gt; "page.html#propdef-marks",
"max-height" =&gt; "visudet.html#propdef-max-height",
"max-width" =&gt; "visudet.html#propdef-max-width",
"min-height" =&gt; "visudet.html#propdef-min-height",
"min-width" =&gt; "visudet.html#propdef-min-width",
"orphans" =&gt; "page.html#propdef-orphans",
"outline" =&gt; "ui.html#propdef-outline",
"outline-color" =&gt; "ui.html#propdef-outline-color",
"outline-style" =&gt; "ui.html#propdef-outline-style",
"outline-width" =&gt; "ui.html#propdef-outline-width",
"overflow" =&gt; "visufx.html#propdef-overflow",
"padding" =&gt; "box.html#propdef-padding",
"padding-top" =&gt; "box.html#propdef-padding-top",
"padding-right" =&gt; "box.html#propdef-padding-right",
"padding-bottom" =&gt; "box.html#propdef-padding-bottom",
"padding-left" =&gt; "box.html#propdef-padding-left",
"page" =&gt; "page.html#propdef-page",
"page-break-after" =&gt; "page.html#propdef-page-break-after",
"page-break-before" =&gt; "page.html#propdef-page-break-before",
"page-break-inside" =&gt; "page.html#propdef-page-break-inside",
"pause" =&gt; "aural.html#propdef-pause",
"pause-after" =&gt; "aural.html#propdef-pause-after",
"pause-before" =&gt; "aural.html#propdef-pause-before",
"pitch" =&gt; "aural.html#propdef-pitch",
"pitch-range" =&gt; "aural.html#propdef-pitch-range",
"play-during" =&gt; "aural.html#propdef-play-during",
"position" =&gt; "visuren.html#propdef-position",
"quotes" =&gt; "generate.html#propdef-quotes",
"richness" =&gt; "aural.html#propdef-richness",
"right" =&gt; "visuren.html#propdef-right",
"size" =&gt; "page.html#propdef-size",
"speak" =&gt; "aural.html#propdef-speak",
"speak-header" =&gt; "tables.html#propdef-speak-header",
"speak-numeral" =&gt; "aural.html#propdef-speak-numeral",
"speak-punctuation" =&gt; "aural.html#propdef-speak-punctuation",
"speech-rate" =&gt; "aural.html#propdef-speech-rate",
"stress" =&gt; "aural.html#propdef-stress",
"table-layout" =&gt; "tables.html#propdef-table-layout",
"text-align" =&gt; "text.html#propdef-text-align",
"text-decoration" =&gt; "text.html#propdef-text-decoration",
"text-indent" =&gt; "text.html#propdef-text-indent",
"text-shadow" =&gt; "text.html#propdef-text-shadow",
"text-transform" =&gt; "text.html#propdef-text-transform",
"top" =&gt; "visuren.html#propdef-top",
"unicode-bidi" =&gt; "visuren.html#propdef-unicode-bidi",
"vertical-align" =&gt; "visudet.html#propdef-vertical-align",
"visibility" =&gt; "visufx.html#propdef-visibility",
"voice-family" =&gt; "aural.html#propdef-voice-family",
"volume" =&gt; "aural.html#propdef-volume",
"white-space" =&gt; "text.html#propdef-white-space",
"widows" =&gt; "page.html#propdef-widows",
"width" =&gt; "visudet.html#propdef-width",
"word-spacing" =&gt; "text.html#propdef-word-spacing",
"z-index" =&gt; "visuren.html#propdef-z-index",
}
cur_line = ENV['TM_CURRENT_LINE']
cur_word = ENV['TM_CURRENT_WORD']
# since dash (‘-’) is not a word character, extend current word to neighboring word and dash characters
$prop_name = /[-\w]*#{Regexp.escape cur_word}[-\w]*/.match(cur_line)[0]
def request_prop_name
s = `\"#{ENV['TM_SUPPORT_PATH']}/bin/CocoaDialog.app/Contents/MacOS/CocoaDialog\" inputbox --title 'Documentation for Property' --informative-text 'What property would you like to lookup?' --text '#{$prop_name}' --button1 'Lookup' --button2 'Cancel' --button3 'Show All Properties'`
case (a = s.split("\n"))[0].to_i
when 1 then $props[a[1].to_s] || "propidx.html"
when 2 then abort "&lt;script&gt;window.close()&lt;/script&gt;"
when 3 then "propidx.html"
end
end
prop_url = $props[$prop_name] || request_prop_name
url = "http://www.w3.org/TR/CSS2/" + prop_url
puts "&lt;meta http-equiv='Refresh' content='0;URL=#{url}'&gt;"
</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>^h</string>
<key>name</key>
<string>Documentation for Property</string>
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>
<string>source.sass</string>
<key>uuid</key>
<string>E2CC7D28-9F0B-4BBB-ACE0-E67682DF3889</string>
</dict>
</plist>
Jump to Line
Something went wrong with that request. Please try again.