Permalink
Browse files

New Preview command

  • Loading branch information...
1 parent 94c6f81 commit 5138afb7beddb38cd8bb29024b4ffc586dd1623a @juanger committed Jan 13, 2009
Showing with 35 additions and 2 deletions.
  1. +24 −0 Commands/Preview.tmCommand
  2. +2 −2 Commands/Publish.tmCommand
  3. +8 −0 Support/lib/preview.rb
  4. +1 −0 info.plist
View
@@ -0,0 +1,24 @@
+<?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
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/preview"</string>
+ <key>input</key>
+ <string>none</string>
+ <key>keyEquivalent</key>
+ <string>^~@p</string>
+ <key>name</key>
+ <string>Preview</string>
+ <key>output</key>
+ <string>showAsHTML</string>
+ <key>scope</key>
+ <string>text.post, text.post text.html.textile</string>
+ <key>uuid</key>
+ <string>4B0F4B09-C302-4E29-9DD4-609B51698F0E</string>
+</dict>
+</plist>
@@ -11,13 +11,13 @@ require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/publish"</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
- <string>^~P</string>
+ <string>@p</string>
<key>name</key>
<string>Publish</string>
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>
- <string>text.post</string>
+ <string>text.post, text.post text.html.textile</string>
<key>uuid</key>
<string>8030C952-EE1F-4D66-909F-E52B1A580B0E</string>
</dict>
View
@@ -0,0 +1,8 @@
+require 'rubygems'
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/post.rb"
+
+TextMode = ENV['TM_MODE'].scan(/Post — (.*)/)[0][0]
+
+post = Post.new(ENV['TM_FILEPATH'], TextMode)
+
+puts post.content
View
@@ -9,6 +9,7 @@
<string>CC9D2EFA-3097-4073-9662-CBCA320C5FAD</string>
<string>249DEB5F-FAD7-486E-A7F9-7625B53AC706</string>
<string>1F7C1D1A-0506-4851-818D-F2A680615501</string>
+ <string>4B0F4B09-C302-4E29-9DD4-609B51698F0E</string>
<string>8030C952-EE1F-4D66-909F-E52B1A580B0E</string>
<string>D71214CE-860C-48F4-9B8E-D0850A7A4A60</string>
</array>

0 comments on commit 5138afb

Please sign in to comment.