Permalink
Browse files

A

couple
of
small
tweaks
to
command
behaviors,
updated
styling
for
dictionary
results,
spelling
guess
command
no
longer
asks
for
confirmation
(it's
easy
enough
to
undo),
and
added
HTML
to
Markdown
conversion
command.
  • Loading branch information...
1 parent 7202452 commit 2da44c7ab3e5458b3fffc716dd293ba893d2d89a @ttscoff committed Apr 24, 2011
@@ -97,10 +97,15 @@ b = <<HTML
<head>
<link rel="stylesheet" href="tm-file://#{ENV['TM_SUPPORT_PATH']}/css/default.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<style type="text/css" media="screen">
- body {background-color: #366;color:#FFC;}
- pre {font-family:"Myriad Pro";font-size:14px;line-height:18px;}
- .dict {background:white;color:#333;padding:1px 10px;-webkit-border-radius: 15px;}
- .defn {border-bottom:dotted 2px #ccc;}
+ body {background-color: #fff;color:#222;}
+ pre {
+ font-family: Georgia;
+ font-size: 13px;
+ line-height: 17px;
+ }
+ .dict {background:white;color:#333;padding:1px 10px;-webkit-border-radius: 8px;border:solid 1px #ccc}
+ .defn {margin-bottom:15px}
+ h4 {font-family: 'helvetica neue', sans-serif;font-size: 0.8em;margin-bottom: 0px;text-transform: uppercase;}
</style>
</head>
<body>
@@ -0,0 +1,36 @@
+<?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/php
+&lt;?php
+require(getenv('TM_BUNDLE_SUPPORT').'/lib/markdownify_extra.php');
+
+// $input = file_get_contents('php://stdin');
+
+$input = stream_get_contents(STDIN);
+
+$linksAfterEachParagraph = true;
+$bodyWidth = 0;
+$keepHTML = false;
+
+$parser = new Markdownify_Extra($linksAfterEachParagraph, $bodyWidth, $keepHTML);
+
+echo $parser-&gt;parseString($input) ."\n";</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>keyEquivalent</key>
+ <string>^@w</string>
+ <key>name</key>
+ <string>Convert HTML to Markdown</string>
+ <key>output</key>
+ <string>replaceSelectedText</string>
+ <key>scope</key>
+ <string>text.html,text.html.markdown, text.html.markdown.multimarkdown</string>
+ <key>uuid</key>
+ <string>C8A638B1-7B9B-4C03-B1FB-02DDDE85142F</string>
+</dict>
+</plist>
@@ -40,11 +40,11 @@ phrase = STDIN.read
newphrase = check_spelling(phrase)
TextMate.exit_show_tool_tip "Looks fine to me…" if newphrase == phrase
unless newphrase.nil?
- res = TextMate::UI.request_confirmation(:button1 =&gt; "Yes, it is", :button2 =&gt; "No, it's not", :title =&gt; "The I Feel Lucky Spell Check",:prompt =&gt; "Is #{newphrase} the word you were looking for?")
- if res == true
+# res = TextMate::UI.request_confirmation(:button1 =&gt; "Yes, it is", :button2 =&gt; "No, it's not", :title =&gt; "The I Feel Lucky Spell Check",:prompt =&gt; "Is #{newphrase} the word you were looking for?")
+# if res == true
print newphrase
TextMate.exit_replace_text
- end
+# end
else
TextMate.exit_show_tool_tip "Nothing found"
end
@@ -9,7 +9,7 @@
input = STDIN.read
-print input.gsub(/\[([^\]]+)\]\: .*?$/,"\\1").gsub(/\[([^\]]+)\]\(.*?\)/,"\\1")</string>
+print input.gsub(/^\s*\[([^\]]+)\]\: .*?$/,"\\1").gsub(/\[([^\]]+)\]\(.*?\)/,"\\1").gsub(/\[(.*?)\]\[\S*?\]/,"\\1")</string>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
Oops, something went wrong.

0 comments on commit 2da44c7

Please sign in to comment.