[Logilogi-svn] SF.net SVN: logilogi:[1679] tools/t-llre/t-llre
Status: Beta
Brought to you by:
wybow
|
From: <wy...@us...> - 2010-02-01 19:07:12
|
Revision: 1679
http://logilogi.svn.sourceforge.net/logilogi/?rev=1679&view=rev
Author: wybow
Date: 2010-02-01 19:07:03 +0000 (Mon, 01 Feb 2010)
Log Message:
-----------
Added titles to paths
Modified Paths:
--------------
tools/t-llre/t-llre
Modified: tools/t-llre/t-llre
===================================================================
--- tools/t-llre/t-llre 2010-02-01 13:04:25 UTC (rev 1678)
+++ tools/t-llre/t-llre 2010-02-01 19:07:03 UTC (rev 1679)
@@ -207,13 +207,13 @@
parsed_path = {}
if parts_lines.size > 1 # A PATH was in there
parsed_path[:id] = parse_path_id(parts_lines[1][0])
+ parsed_path[:title] = parse_path_title(parts_lines[0].join("\n"))
parsed_path[:enabled] = true
parsed_path[:step_hashes] = []
i = 0
parsed_logis.each do |logi_hash|
parsed_path[:step_hashes] << {
:logi_link => logi_hash[:logi_link],
- :title => logi_hash[:title],
:level => logi_hash[:level],
:position => i}
i += 1
@@ -242,7 +242,7 @@
old_path = LLRemote::Path.find(parsed_path[:id])
old_path.destroy
end
- path = LLRemote::Path.new
+ path = LLRemote::Path.new(:title => parsed_path[:title])
path.save
parsed_path[:step_hashes].each do |step_hash|
step = LLRemote::Step.new(:path => path, :logi_link => step_hash[:logi_link],
@@ -313,6 +313,12 @@
end
end
+ def parse_path_title(top_part)
+ top_part =~ /^\\\w*title.*\{(.*)\}/
+ match = $~
+ return match[1].gsub("\\\\"," ")
+ end
+
def replace_latex(text, link)
text.gsub!(/^%.*(\n|$)/, "")
text.gsub!("\\_", "_")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|