Skip to content

Commit

Permalink
• add Refresh and Edit links to the top of the page
Browse files Browse the repository at this point in the history
• 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 8386aff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Support/bin/linkify.rb
Expand Up @@ -32,11 +32,17 @@ def e_sh_js(str)
open("|#{e_sh markdown} > #{e_sh dst_name}", "w") do |io| open("|#{e_sh markdown} > #{e_sh dst_name}", "w") do |io|
io << DATA.read 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 line_no = 1
open(file) do |src| open(file) do |src|
src.each_line do |line| src.each_line do |line|
if 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 end


line = line.gsub(/\[([^\]]+)\]\[\]/) do |m| line = line.gsub(/\[([^\]]+)\]\[\]/) do |m|
Expand Down

0 comments on commit 8386aff

Please sign in to comment.