Permalink
Browse files

• add Refresh and Edit links to the top of the page

• fix the (edit) link after headings (to not be at the next line)

I forgot to mention that this script has a hardcoded path to Markdown.pl (~/Library/Application Support/TextMate/Support/bin)

git-svn-id: http://svn.textmate.org/trunk/Bundles/Experimental Wiki.tmbundle@5249 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
sorbits committed Sep 17, 2006
1 parent 3197d34 commit 8386aff3f5a9718e64eb1a4c2d5a2939a92f63f1
Showing with 7 additions and 1 deletion.
  1. +7 −1 Support/bin/linkify.rb
View
@@ -32,11 +32,17 @@ def e_sh_js(str)
open("|#{e_sh markdown} > #{e_sh dst_name}", "w") do |io|
io << DATA.read
+ io << <<-HTML
+<a href='#' onClick='visit(\"#{e_sh_js script}\", \"#{e_sh_js path.to_s}\"); return false;'>Refresh</a>
+<a href='txmt://open?url=file://#{e_url path.to_s}'>Edit</a>
+<hr />
+HTML
+
line_no = 1
open(file) do |src|
src.each_line do |line|
if line =~ /^#+.*/
- line = line + " <small>(<a href='txmt://open?line=#{line_no + 1}&url=file://#{e_url path.to_s}'>edit</a>)</small>"
+ line = line.chomp + " <small>(<a href='txmt://open?line=#{line_no + 1}&url=file://#{e_url path.to_s}'>edit</a>)</small>\n"
end
line = line.gsub(/\[([^\]]+)\]\[\]/) do |m|

0 comments on commit 8386aff

Please sign in to comment.