Skip to content

Instantly share code, notes, and snippets.

@jamesu
Created December 30, 2013 13:51
Show Gist options
  • Save jamesu/8182306 to your computer and use it in GitHub Desktop.
Save jamesu/8182306 to your computer and use it in GitHub Desktop.
Convert Notational Velocity notes into tiddywiki tiddlers suitable for inserting into a TiddlyWiki file
note_html = []
Dir["./notes/candidates/*.txt"].each do |file|
ftime = File.mtime(file)
name = file.split("/")[-1]
puts "FILE #{name} CREATED #{ftime}"
File.open(file) do |f|
timestamp = ftime.strftime("%Y%m%d%H%M")
note_html << "<div changecount=\"1\" created=\"#{timestamp}\" modified=\"#{timestamp}\" modifier=\"JamesU\" tags=\"notational\" title=\"#{name}\"><pre>#{f.read}</pre></div>"
end
end
puts note_html.join("\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment