module Dyndoc::Edit
Public Class Methods
get_docs(doc_tags_info)
click to toggle source
# File lib/dyndoc-edit.rb, line 63 def Edit.get_docs(doc_tags_info) Edit.docs_from_doc_tags_info(doc_tags_info) end
html_file(doc,user=nil)
click to toggle source
# File lib/dyndoc-edit.rb, line 79 def Edit.html_file(doc,user=nil) #doc={tag: ..., dyn_file: ..., doc_tags_info: ...} html_file=File.join(File.dirname(doc[:dyn_file]),File.basename(doc[:dyn_file],".*")+".html") docs=Edit.get_docs(doc[:doc_tags_info]) if !docs.empty? and docs.keys.include? doc[:tag] doc_extra=docs[doc[:tag]] if doc_extra[0,1]=="_" doc_extra +=doc[:tag] if doc_extra.length==1 html_file=File.join(File.dirname(doc[:dyn_file]),File.basename(doc[:dyn_file],".*")+doc_extra+".html") elsif doc_extra[0,1]=="~" # from user root if user html_file=File.join("/users",user,doc_extra[1..-1]+".html") end elsif doc_extra[0,1]=="/" # from global root html_file=File.join(doc_extra[1..-1]+".html") elsif !doc_extra.empty? html_file=File.join(File.dirname(doc[:dyn_file]),doc_extra+".html") end end return html_file end
html_files(doc,user=nil)
click to toggle source
# File lib/dyndoc-edit.rb, line 102 def Edit.html_files(doc,user=nil) #doc={dyn_file: ..., doc_tags_info: ...} html_files={} doc_tags=[""]+Edit.get_doc_tags(doc[:doc_tags_info]) doc2=doc.dup doc_tags.each do |tag| doc2[:tag]=tag html_file=Edit.html_file(doc2,user) html_files[tag]=html_file end return html_files end