You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by xa...@apache.org on 2006/12/18 17:00:04 UTC
svn commit: r488339 - /incubator/ivy/trunk/src/doc/dxml_to_xooki.rb
Author: xavier
Date: Mon Dec 18 09:00:03 2006
New Revision: 488339
URL: http://svn.apache.org/viewvc?view=rev&rev=488339
Log:
review url generation for some links + proper toc generation
Modified:
incubator/ivy/trunk/src/doc/dxml_to_xooki.rb
Modified: incubator/ivy/trunk/src/doc/dxml_to_xooki.rb
URL: http://svn.apache.org/viewvc/incubator/ivy/trunk/src/doc/dxml_to_xooki.rb?view=diff&rev=488339&r1=488338&r2=488339
==============================================================================
--- incubator/ivy/trunk/src/doc/dxml_to_xooki.rb (original)
+++ incubator/ivy/trunk/src/doc/dxml_to_xooki.rb Mon Dec 18 09:00:03 2006
@@ -80,16 +80,10 @@
doc = Document.new(File.new(book))
root = doc.root
- p "building node index..."
- nodes = Hash.new
- root.each_element("//node") do |node|
- nodes[get_path(node)] = node
- end
-
p "generating toc..."
FileUtils.mkdir_p(todir)
f = File.new(todir+"/toc.json", 'w')
- f.puts gen_toc(root)
+ f.puts '{children:['+gen_toc(root)+']}'
f.close
p "starting generation..."
@@ -107,13 +101,9 @@
base = "../" * pathdepth
content = node.elements["content"].cdatas.to_s
- content.gsub!(/href="\.?\/([^"]+)"/) do |s|
- npath = $1.gsub(/^ivy\//, '')
- if nodes[npath]
- 'href="'+base+npath +'.'+@ext+'"'
- else
- 'href="'+@site + '/' +npath+'.'+@ext+'"'
- end
+ content.gsub!(/href="\.?\/ivy\/([^"]+)"/) do |s|
+ npath = $1
+ 'href="'+base+npath +'.'+@ext+'"'
end
# p " processing template"