Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Commit

Permalink
Overhauled commands to work with Pandoc 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanson committed Jan 31, 2011
1 parent 85b8b16 commit b4e2028
Show file tree
Hide file tree
Showing 26 changed files with 219 additions and 1,572 deletions.
6 changes: 5 additions & 1 deletion Commands/Center Pandoc Metadata.tmCommand
Expand Up @@ -6,6 +6,10 @@
<string>nop</string> <string>nop</string>
<key>command</key> <key>command</key>
<string>#!/usr/bin/env ruby <string>#!/usr/bin/env ruby
#
# This script centers pandoc title blocks
# to make them look nice.
#
meta = 1 meta = 1
width = ENV['TM_COLUMNS'].to_i width = ENV['TM_COLUMNS'].to_i
Expand All @@ -25,7 +29,7 @@ end
<key>input</key> <key>input</key>
<string>document</string> <string>document</string>
<key>name</key> <key>name</key>
<string>Center Pandoc Metadata</string> <string>Center Title Block</string>
<key>output</key> <key>output</key>
<string>replaceDocument</string> <string>replaceDocument</string>
<key>scope</key> <key>scope</key>
Expand Down
2 changes: 1 addition & 1 deletion Commands/Convert HTML to Markdown.tmCommand
Expand Up @@ -11,7 +11,7 @@
<key>keyEquivalent</key> <key>keyEquivalent</key>
<string>^~@m</string> <string>^~@m</string>
<key>name</key> <key>name</key>
<string>HTML to Markdown</string> <string>Convert HTML to Markdown</string>
<key>output</key> <key>output</key>
<string>openAsNewDocument</string> <string>openAsNewDocument</string>
<key>scope</key> <key>scope</key>
Expand Down
Expand Up @@ -5,7 +5,7 @@
<key>beforeRunningCommand</key> <key>beforeRunningCommand</key>
<string>nop</string> <string>nop</string>
<key>command</key> <key>command</key>
<string>perl -pe 's/\[\]\[#(.*?)\]/[$1]/g' | perl -pe 's/\[(.*?)\]\[#(.*?)\]/[$2\@$1]/g' <string>perl -pe 's/\[\]\[#(.*?)\]/[@$1]/g' | perl -pe 's/\[(.*?)\]\[\#(.*?)\]/[\@$2, $1]/g'
</string> </string>
<key>input</key> <key>input</key>
Expand Down
2 changes: 1 addition & 1 deletion Commands/Convert to ConTeXt (citations).tmCommand
Expand Up @@ -5,7 +5,7 @@
<key>beforeRunningCommand</key> <key>beforeRunningCommand</key>
<string>nop</string> <string>nop</string>
<key>command</key> <key>command</key>
<string>pandoc -Ss -w context </string> <string>pandoc -Ss -w context --bibliography=$TM_PANDOC_BIB</string>
<key>input</key> <key>input</key>
<string>selection</string> <string>selection</string>
<key>keyEquivalent</key> <key>keyEquivalent</key>
Expand Down
2 changes: 1 addition & 1 deletion Commands/Convert to LaTeX (citations).tmCommand
Expand Up @@ -5,7 +5,7 @@
<key>beforeRunningCommand</key> <key>beforeRunningCommand</key>
<string>nop</string> <string>nop</string>
<key>command</key> <key>command</key>
<string>pandoc -sS -w latex --biblio=$TM_PANDOC_BIB --biblio-format=$TM_PANDOC_BIBTYPE --csl=$TM_PANDOC_CSL</string> <string>pandoc -sS -w latex --bibliography=$TM_PANDOC_BIB</string>
<key>input</key> <key>input</key>
<string>selection</string> <string>selection</string>
<key>keyEquivalent</key> <key>keyEquivalent</key>
Expand Down
6 changes: 3 additions & 3 deletions Commands/Convert to ODT (author-date citations).tmCommand
Expand Up @@ -7,8 +7,8 @@
<key>command</key> <key>command</key>
<string># $TM_FILEPATH: full path of current doc <string># $TM_FILEPATH: full path of current doc
filename=${TM_FILEPATH} filename="${TM_FILEPATH}"
basename=${filename%.*} basename="${filename%.*}"
# Find a unique name # Find a unique name
Expand All @@ -26,7 +26,7 @@ targetname="$basename$connective$inc.odt"
# run pandoc # run pandoc
echo "&lt;pre&gt;" echo "&lt;pre&gt;"
pandoc -sS -o "$targetname" --biblio=$TM_PANDOC_BIB --biblio-format=$TM_PANDOC_BIBTYPE --csl=$TM_PANDOC_CSL pandoc -sS -o "$targetname" --bibliography=$TM_PANDOC_BIB
echo "&lt;/pre&gt;" echo "&lt;/pre&gt;"
# verify that the file exists # verify that the file exists
Expand Down
35 changes: 0 additions & 35 deletions Commands/Convert to PDF (citations).tmCommand

This file was deleted.

35 changes: 0 additions & 35 deletions Commands/Convert to PDF (no citations).tmCommand

This file was deleted.

4 changes: 2 additions & 2 deletions Commands/Convert to PDF via LaTeX (citations).tmCommand
Expand Up @@ -17,14 +17,14 @@ if [ -f "$basename.pdf" ]; then
cp "$basename.pdf" "$basename-old.pdf" cp "$basename.pdf" "$basename-old.pdf"
fi fi
echo "&lt;pre&gt;" echo "&lt;pre&gt;"
markdown2pdf $opts --biblio="$TM_PANDOC_BIB" --biblio-format="$TM_PANDOC_BIBTYPE" --csl="$TM_PANDOC_CSL" -o "$basename.pdf" &amp;&amp; open "$basename.pdf" markdown2pdf $opts --bibliography="$TM_PANDOC_BIB" -o "$basename.pdf" &amp;&amp; open "$basename.pdf"
echo "&lt;/pre&gt;"</string> echo "&lt;/pre&gt;"</string>
<key>input</key> <key>input</key>
<string>selection</string> <string>selection</string>
<key>keyEquivalent</key> <key>keyEquivalent</key>
<string>^~@p</string> <string>^~@p</string>
<key>name</key> <key>name</key>
<string>Convert to PDF via LaTeX (citations)</string> <string>Convert to PDF (citations)</string>
<key>output</key> <key>output</key>
<string>showAsHTML</string> <string>showAsHTML</string>
<key>scope</key> <key>scope</key>
Expand Down
2 changes: 1 addition & 1 deletion Commands/Convert to PDF via LaTeX.tmCommand
Expand Up @@ -24,7 +24,7 @@ echo "&lt;/pre&gt;"</string>
<key>keyEquivalent</key> <key>keyEquivalent</key>
<string>^~@p</string> <string>^~@p</string>
<key>name</key> <key>name</key>
<string>Convert to PDF via LaTeX</string> <string>Convert to PDF</string>
<key>output</key> <key>output</key>
<string>showAsHTML</string> <string>showAsHTML</string>
<key>scope</key> <key>scope</key>
Expand Down
35 changes: 0 additions & 35 deletions Commands/Convert to PDF via XeLaTeX (citations).tmCommand

This file was deleted.

36 changes: 0 additions & 36 deletions Commands/Convert to PDF via XeLaTeX.tmCommand

This file was deleted.

3 changes: 2 additions & 1 deletion Commands/Demote Headers.tmCommand
Expand Up @@ -5,7 +5,8 @@
<key>beforeRunningCommand</key> <key>beforeRunningCommand</key>
<string>nop</string> <string>nop</string>
<key>command</key> <key>command</key>
<string># this calls a compiled haskell program. The source is in the <string># this calls a compiled haskell program.
# The source is in the
# Pandoc.tmbundle/Support/bin # Pandoc.tmbundle/Support/bin
demoteheaders</string> demoteheaders</string>
Expand Down
11 changes: 10 additions & 1 deletion Commands/Freshen Date.tmCommand
Expand Up @@ -5,7 +5,16 @@
<key>beforeRunningCommand</key> <key>beforeRunningCommand</key>
<string>nop</string> <string>nop</string>
<key>command</key> <key>command</key>
<string>date=`date "+%B %d, %Y"` <string># If the document has a three-line pandoc title
# block, this should put the current date
# on the third line.
#
# Note that it is pretty dumb: it won't handle
# the multi-line title or author fields that
# pandoc allows
#
date=`date "+%B %d, %Y"`
sed "3 s/%.*/% $date/"</string> sed "3 s/%.*/% $date/"</string>
<key>input</key> <key>input</key>
<string>document</string> <string>document</string>
Expand Down
3 changes: 1 addition & 2 deletions Commands/Generate HTML (author-date citations).tmCommand
Expand Up @@ -5,8 +5,7 @@
<key>beforeRunningCommand</key> <key>beforeRunningCommand</key>
<string>nop</string> <string>nop</string>
<key>command</key> <key>command</key>
<string>pandoc -Ss --biblio=$TM_PANDOC_BIB --biblio-format=$TM_PANDOC_BIBTYPE --csl=$TM_PANDOC_CSL <string>pandoc -Ss --bibliography=$TM_PANDOC_BIB</string>
</string>
<key>input</key> <key>input</key>
<string>selection</string> <string>selection</string>
<key>keyEquivalent</key> <key>keyEquivalent</key>
Expand Down
Expand Up @@ -5,8 +5,7 @@
<key>beforeRunningCommand</key> <key>beforeRunningCommand</key>
<string>nop</string> <string>nop</string>
<key>command</key> <key>command</key>
<string>pandoc -Ss --biblio=$TM_PANDOC_BIB --biblio-format=$TM_PANDOC_BIBTYPE --csl=$TM_PANDOC_CSL <string>pandoc -Ss --bibliography=$TM_PANDOC_BIB
</string> </string>
<key>input</key> <key>input</key>
<string>selection</string> <string>selection</string>
Expand Down
3 changes: 2 additions & 1 deletion Commands/Promote Headers.tmCommand
Expand Up @@ -5,7 +5,8 @@
<key>beforeRunningCommand</key> <key>beforeRunningCommand</key>
<string>nop</string> <string>nop</string>
<key>command</key> <key>command</key>
<string># this calls a compiled haskell program. The source is in the <string># this calls a compiled haskell program.
# The source is in the
# Pandoc.tmbundle/Support/bin # Pandoc.tmbundle/Support/bin
promoteheaders</string> promoteheaders</string>
Expand Down
4 changes: 1 addition & 3 deletions Commands/Tabs to Bullets.tmCommand
Expand Up @@ -5,9 +5,7 @@
<key>beforeRunningCommand</key> <key>beforeRunningCommand</key>
<string>nop</string> <string>nop</string>
<key>command</key> <key>command</key>
<string># Adapted from the wonderful Outlines Bundle, modified <string># Taken from the wonderful Outlines Bundle.
# so that the conversion looks more like the bullets pandoc
# generates.
perl -pe 's/^(\s*)/\1- /'</string> perl -pe 's/^(\s*)/\1- /'</string>
<key>input</key> <key>input</key>
Expand Down
2 changes: 1 addition & 1 deletion Commands/m2m: nowrap, ref, cites.tmCommand
Expand Up @@ -5,7 +5,7 @@
<key>beforeRunningCommand</key> <key>beforeRunningCommand</key>
<string>nop</string> <string>nop</string>
<key>command</key> <key>command</key>
<string>pandoc -s -t markdown --no-wrap --reference-links --biblio=$TM_PANDOC_BIB --biblio-format=$TM_PANDOC_BIBTYPE --csl=$TM_PANDOC_CSL</string> <string>pandoc -s -t markdown --no-wrap --reference-links --bibliography=$TM_PANDOC_BIB</string>
<key>input</key> <key>input</key>
<string>selection</string> <string>selection</string>
<key>keyEquivalent</key> <key>keyEquivalent</key>
Expand Down
2 changes: 1 addition & 1 deletion Commands/m2m: wrap, inline, ref.tmCommand
Expand Up @@ -5,7 +5,7 @@
<key>beforeRunningCommand</key> <key>beforeRunningCommand</key>
<string>nop</string> <string>nop</string>
<key>command</key> <key>command</key>
<string>pandoc -s -t markdown --biblio=$TM_PANDOC_BIB --biblio-format=$TM_PANDOC_BIBTYPE --csl=$TM_PANDOC_CSL --reference-links</string> <string>pandoc -s -t markdown --bibliography=$TM_PANDOC_BIB --reference-links</string>
<key>input</key> <key>input</key>
<string>selection</string> <string>selection</string>
<key>keyEquivalent</key> <key>keyEquivalent</key>
Expand Down
20 changes: 0 additions & 20 deletions Commands/untitled 2.tmCommand

This file was deleted.

0 comments on commit b4e2028

Please sign in to comment.