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

Commit

Permalink
Adding a command to center metadata
Browse files Browse the repository at this point in the history
Inspired by Michael Thompson's discussion [here](https://groups.google.com/group/pandoc-discuss/msg/9bba02be44051acc?).
  • Loading branch information
dsanson committed Aug 6, 2010
1 parent ce8bfbb commit 6280ea8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Commands/Center Pandoc Metadata.tmCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?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
meta = 1
ARGF.each do |line|
if line =~ /^%/ &amp;&amp; meta
line.slice!(/%\s+/)
line = line.chomp.center(78)
line.slice!(/\s+$/)
puts "%" + line
else
meta = 0
puts line.chomp
end
end
</string>
<key>input</key>
<string>document</string>
<key>name</key>
<string>Center Pandoc Metadata</string>
<key>output</key>
<string>replaceDocument</string>
<key>scope</key>
<string>text.html.markdown.pandoc</string>
<key>uuid</key>
<string>07B9D09D-B6A6-42CE-9D98-0586B34A0411</string>
</dict>
</plist>
1 change: 1 addition & 0 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
<string>8A4B83DD-08A2-46ED-9219-78AAD9A797B0</string>
<string>0E35F798-452C-4D7A-8E67-3741F684C43B</string>
<string>56146758-265F-4F83-8322-B77A03E76DB1</string>
<string>07B9D09D-B6A6-42CE-9D98-0586B34A0411</string>
<string>0AD3F1A6-18CD-459E-90F3-D216F6DC2F62</string>
<string>9D2B64FF-F35F-428B-8751-67BE205EEDE4</string>
<string>D8A2538F-BA09-42BB-AE66-8EF2E1EFA7D8</string>
Expand Down

0 comments on commit 6280ea8

Please sign in to comment.