Browse files

Added commands; reorganized menus; changed some key equivalents

Added commands to convert to ConTeXt. Added commands to convert to PDF via LaTeX. Removed "Split File By Sections" command: it was too hackish. Renamed the "Convert from Markdown" menu to "Convert", since the commands will convert from any format that pandoc can take as input, not just markdown. Renamed all Blah (no citations) commands to just Blah. Renamed the "Markdown to Markdown" menu to "Tidy Markdown" to make it more clear what the point is. Also changed their key equivalents to ctrl-opt-cmd-T instead of ctrl-opt-cmd-C.

Probably made other changes and broke things...
  • Loading branch information...
1 parent ad1f0b9 commit f9a771f042407074e240dd5fbc1312ad4f92aca6 @dsanson committed May 26, 2010
View
2 Commands/Convert HTML to Markdown.tmCommand
@@ -11,7 +11,7 @@
<key>keyEquivalent</key>
<string>^~@m</string>
<key>name</key>
- <string>Convert from HTML</string>
+ <string>HTML to Markdown</string>
<key>output</key>
<string>openAsNewDocument</string>
<key>scope</key>
View
20 Commands/Convert to ConTeXt (citations).tmCommand
@@ -0,0 +1,20 @@
+<?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>pandoc -Ss -w context </string>
+ <key>input</key>
+ <string>selection</string>
+ <key>name</key>
+ <string>Convert to ConTeXt (citations)</string>
+ <key>output</key>
+ <string>openAsNewDocument</string>
+ <key>scope</key>
+ <string>text.html.markdown.pandoc</string>
+ <key>uuid</key>
+ <string>75BB501B-4D6C-46F1-B2C3-DA2848921FD3</string>
+</dict>
+</plist>
View
2 Commands/Convert to ConTeXt (no citations).tmCommand
@@ -9,7 +9,7 @@
<key>input</key>
<string>selection</string>
<key>name</key>
- <string>Convert to ConTeXt (no citations)</string>
+ <string>Convert to ConTeXt</string>
<key>output</key>
<string>openAsNewDocument</string>
<key>scope</key>
View
2 Commands/Convert to LaTeX (no citations).tmCommand
@@ -11,7 +11,7 @@
<key>keyEquivalent</key>
<string>^~@l</string>
<key>name</key>
- <string>Convert to LaTeX (no citations)</string>
+ <string>Convert to LaTeX</string>
<key>output</key>
<string>openAsNewDocument</string>
<key>scope</key>
View
2 Commands/Convert to ODT.tmCommand
@@ -49,7 +49,7 @@ fi</string>
<key>keyEquivalent</key>
<string>^~@o</string>
<key>name</key>
- <string>Convert to ODT (no citations)</string>
+ <string>Convert to ODT</string>
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>
View
4 Commands/Convert to PDF (citations).tmCommand
@@ -16,7 +16,7 @@ if [ -f "$basename.pdf" ]; then
cp "$basename.pdf" "$basename-old.pdf"
fi
echo "&lt;pre&gt;"
-pandoc -w context -sS --biblio=$TM_PANDOC_BIB --biblio-format=$TM_PANDOC_BIBTYPE --csl=$TM_PANDOC_CSL "$@" &gt; $basename.tex
+pandoc -w context -sS --biblio=$TM_PANDOC_BIB --biblio-format=$TM_PANDOC_BIBTYPE --csl=$TM_PANDOC_CSL &gt; $basename.tex
texexec --purgeall --pdf $basename.tex
open $basename.pdf
echo "&lt;/pre&gt;"</string>
@@ -25,7 +25,7 @@ echo "&lt;/pre&gt;"</string>
<key>keyEquivalent</key>
<string>^~@p</string>
<key>name</key>
- <string>Convert to PDF (citations)</string>
+ <string>Convert to PDF via ConTeXt (citations)</string>
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>
View
4 Commands/Convert to PDF (no citations).tmCommand
@@ -16,7 +16,7 @@ if [ -f "$basename.pdf" ]; then
cp "$basename.pdf" "$basename-old.pdf"
fi
echo "&lt;pre&gt;"
-pandoc -w context -sS "$@" &gt; $basename.tex
+pandoc -w context -sS &gt; $basename.tex
texexec --purgeall --pdf $basename.tex
open $basename.pdf
echo "&lt;/pre&gt;"</string>
@@ -25,7 +25,7 @@ echo "&lt;/pre&gt;"</string>
<key>keyEquivalent</key>
<string>^~@p</string>
<key>name</key>
- <string>Convert to PDF (no citations)</string>
+ <string>Convert to PDF via ConTeXt</string>
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>
View
36 Commands/Convert to PDF via LaTeX (citations).tmCommand
@@ -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>saveActiveFile</string>
+ <key>command</key>
+ <string>#!/bin/sh
+
+filename=$TM_FILEPATH
+basename=${filename%.*}
+if [ -f "$basename.tex" ]; then
+ cp "$basename.tex" "$basename-old.tex"
+fi
+if [ -f "$basename.pdf" ]; then
+ cp "$basename.pdf" "$basename-old.pdf"
+fi
+echo "&lt;pre&gt;"
+pandoc -w latex -sS --biblio=$TM_PANDOC_BIB --biblio-format=$TM_PANDOC_BIBTYPE --csl=$TM_PANDOC_CSL &gt; $basename.tex
+pdflatex $basename.tex
+open $basename.pdf
+echo "&lt;/pre&gt;"</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>keyEquivalent</key>
+ <string>^~@p</string>
+ <key>name</key>
+ <string>Convert to PDF via LaTeX (citations)</string>
+ <key>output</key>
+ <string>showAsHTML</string>
+ <key>scope</key>
+ <string>text.html.markdown.pandoc</string>
+ <key>uuid</key>
+ <string>B6A43DBC-AC7B-40CF-B272-A841892E14CD</string>
+</dict>
+</plist>
View
36 Commands/Convert to PDF via LaTeX.tmCommand
@@ -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>saveActiveFile</string>
+ <key>command</key>
+ <string>#!/bin/sh
+
+filename=$TM_FILEPATH
+basename=${filename%.*}
+if [ -f "$basename.tex" ]; then
+ cp "$basename.tex" "$basename-old.tex"
+fi
+if [ -f "$basename.pdf" ]; then
+ cp "$basename.pdf" "$basename-old.pdf"
+fi
+echo "&lt;pre&gt;"
+pandoc -w latex -sS &gt; $basename.tex
+pdflatex $basename.tex
+open $basename.pdf
+echo "&lt;/pre&gt;"</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>keyEquivalent</key>
+ <string>^~@p</string>
+ <key>name</key>
+ <string>Convert to PDF via LaTeX</string>
+ <key>output</key>
+ <string>showAsHTML</string>
+ <key>scope</key>
+ <string>text.html.markdown.pandoc</string>
+ <key>uuid</key>
+ <string>5623E00B-B49D-44B5-A37D-DBD6261E2FA1</string>
+</dict>
+</plist>
View
2 Commands/Generate HTML (author-date citations).tmCommand
@@ -12,7 +12,7 @@
<key>keyEquivalent</key>
<string>^~@h</string>
<key>name</key>
- <string>Convert to HTML (citations)</string>
+ <string>Convert to Standalone HTML (citations)</string>
<key>output</key>
<string>openAsNewDocument</string>
<key>scope</key>
View
2 Commands/Generate HTML (no citations).tmCommand
@@ -11,7 +11,7 @@
<key>keyEquivalent</key>
<string>^~@h</string>
<key>name</key>
- <string>Convert to HTML (no citations)</string>
+ <string>Convert to Standalone HTML</string>
<key>output</key>
<string>openAsNewDocument</string>
<key>scope</key>
View
2 Commands/Preview as HTML (no citations).tmCommand
@@ -11,7 +11,7 @@
<key>keyEquivalent</key>
<string>^~@p</string>
<key>name</key>
- <string>Preview as HTML (no citations)</string>
+ <string>Preview as HTML</string>
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>
View
36 Commands/Split File By Sections.tmCommand
@@ -1,36 +0,0 @@
-<?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># This is an ugly hack. It should be rewritten to
-# produce file names based upon headers.
-#
-# as written, it splits files at the first header level.
-# Add additional "#"s to the regexp as needed to adjust this.
-#
-
-filename=${TM_FILEPATH}
-basename=${filename%.*}
-if [ -d "$basename"_split ]; then
- mv "$basename"_split "$basename"_split_old
-else
- mkdir "$basename"_split
-fi
-csplit -sk -f "$basename"_split/xx - "/^##*/" "{99}"
-rename "s/(.*)/\1.markdown/" "$basename"_split/xx*
-open -a "TextMate" "$basename"_split</string>
- <key>input</key>
- <string>document</string>
- <key>name</key>
- <string>Split File By Sections</string>
- <key>output</key>
- <string>discard</string>
- <key>scope</key>
- <string>text.html.markdown.pandoc</string>
- <key>uuid</key>
- <string>8E58742F-7F16-4AFC-B3A3-374BC5BBB5ED</string>
-</dict>
-</plist>
View
20 Commands/Tabs to Bullets.tmCommand
@@ -0,0 +1,20 @@
+<?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># Adapted from the wonderful Outlines Bundle
+
+perl -pe 's/^(\s*)/\1- /'</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>name</key>
+ <string>Tabs to Bullets</string>
+ <key>output</key>
+ <string>replaceSelectedText</string>
+ <key>uuid</key>
+ <string>A2527DED-32A3-4E5D-A09D-6545790F11FB</string>
+</dict>
+</plist>
View
4 Commands/untitled 2.tmCommand
@@ -6,10 +6,12 @@
<string>nop</string>
<key>command</key>
<string>pandoc -f html "$TM_SELECTED_TEXT"</string>
+ <key>fallbackInput</key>
+ <string>none</string>
<key>input</key>
<string>selection</string>
<key>name</key>
- <string>Convert from URL</string>
+ <string>Download selected URL and convert to Markdown</string>
<key>output</key>
<string>openAsNewDocument</string>
<key>uuid</key>
View
2 .../convert odt, doc, docx, rtf, wordml, webarchive to markdown using textutil.tmDragCommand
@@ -5,7 +5,7 @@
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
- <string>textutil -convert html -stdout "$TM_DROPPED_FILE" | pandoc -s --no-wrap --reference-links</string>
+ <string>textutil -convert html -stdout "$TM_DROPPED_FILE" | pandoc -t markdown -s --no-wrap --reference-links</string>
<key>draggedFileExtensions</key>
<array>
<string>odt</string>
View
22 info.plist
@@ -8,6 +8,10 @@
<array>
<string>FB873C90-C7F1-4D31-911C-006D18F067A7</string>
<string>51483E7C-0AED-4391-A5F2-C15A51075D8E</string>
+ <string>5C179C7F-7DE7-4938-B321-CDEAF8ED7AB1</string>
+ <string>9ADEFA96-75B7-490C-9790-7423EF423BCF</string>
+ <string>8E58742F-7F16-4AFC-B3A3-374BC5BBB5ED</string>
+ <string>B7E55E21-D63C-4A7A-904F-7E566585F447</string>
<string>9D4C07F6-13CF-4003-B52D-B9556B3CAAF1</string>
<string>3E5BCC59-840A-430B-B0D9-B477EC696789</string>
<string>E16657DC-41AF-47DA-A90A-20F27C308116</string>
@@ -32,12 +36,16 @@
<dict>
<key>items</key>
<array>
+ <string>5623E00B-B49D-44B5-A37D-DBD6261E2FA1</string>
+ <string>75BB501B-4D6C-46F1-B2C3-DA2848921FD3</string>
<string>132A7DFF-E366-4A3A-93A1-F6EA8534CC03</string>
<string>429CFB6E-CD9A-4EB2-A0D4-E1CD17F94C80</string>
<string>AA1CB3C8-7D9E-4ADA-ACD5-BEF3DDFD1E7D</string>
<string>0AF6F61D-7FB0-4016-A4C2-79F3DEE1B635</string>
+ <string>474C6A24-452A-4372-A7FC-9A65FE244C42</string>
<string>F2FB9B3F-B700-4515-9C00-820F257CC2E7</string>
<string>C8A41311-5DBC-4546-9940-18597760A860</string>
+ <string>B6A43DBC-AC7B-40CF-B272-A841892E14CD</string>
<string>FCC3D469-5CF5-4DC5-B5DD-69C522024FCD</string>
<string>77D46B3B-7A44-42EE-8082-3E25B7F28D12</string>
<string>5FAA645C-3E47-4B3A-9E36-E40613D7AC49</string>
@@ -58,6 +66,15 @@
<key>name</key>
<string>Preview</string>
</dict>
+ <key>B7E55E21-D63C-4A7A-904F-7E566585F447</key>
+ <dict>
+ <key>items</key>
+ <array>
+ <string>ED6332E1-BDBF-44CC-B0B4-84FC32A15745</string>
+ </array>
+ <key>name</key>
+ <string>Convert to Markdown</string>
+ </dict>
<key>E16657DC-41AF-47DA-A90A-20F27C308116</key>
<dict>
<key>items</key>
@@ -91,6 +108,7 @@
<array>
<string>FB873C90-C7F1-4D31-911C-006D18F067A7</string>
<string>51483E7C-0AED-4391-A5F2-C15A51075D8E</string>
+ <string>A2527DED-32A3-4E5D-A09D-6545790F11FB</string>
<string>5D52B25C-4BF1-4358-97AA-5BC78B0F43EC</string>
<string>87A1D7C7-2417-49D0-96A3-6ECED39EA4FD</string>
<string>FF5A787C-9E5B-4FA3-95E9-D3148939CAA1</string>
@@ -105,14 +123,16 @@
<string>132A7DFF-E366-4A3A-93A1-F6EA8534CC03</string>
<string>474C6A24-452A-4372-A7FC-9A65FE244C42</string>
<string>429CFB6E-CD9A-4EB2-A0D4-E1CD17F94C80</string>
+ <string>75BB501B-4D6C-46F1-B2C3-DA2848921FD3</string>
<string>0AF6F61D-7FB0-4016-A4C2-79F3DEE1B635</string>
<string>AA1CB3C8-7D9E-4ADA-ACD5-BEF3DDFD1E7D</string>
+ <string>B6A43DBC-AC7B-40CF-B272-A841892E14CD</string>
+ <string>5623E00B-B49D-44B5-A37D-DBD6261E2FA1</string>
<string>A159701F-7F2B-4732-BEB5-0119ECCCCF62</string>
<string>6238103B-D750-49FA-8C9C-B4078167C204</string>
<string>BC891659-5D4C-431C-A806-D7A26377E3EE</string>
<string>8A4B83DD-08A2-46ED-9219-78AAD9A797B0</string>
<string>0E35F798-452C-4D7A-8E67-3741F684C43B</string>
- <string>8E58742F-7F16-4AFC-B3A3-374BC5BBB5ED</string>
<string>56146758-265F-4F83-8322-B77A03E76DB1</string>
<string>0AD3F1A6-18CD-459E-90F3-D216F6DC2F62</string>
<string>9D2B64FF-F35F-428B-8751-67BE205EEDE4</string>

0 comments on commit f9a771f

Please sign in to comment.