2008-01-12 22:13:37 -05:00
|
|
|
require 'rdoc/generator/xml'
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-12 22:13:37 -05:00
|
|
|
module RDoc::Generator::XML::RDF
|
2008-01-12 22:02:49 -05:00
|
|
|
|
|
|
|
CONTENTS_RDF = <<-EOF
|
2008-01-07 05:40:50 -05:00
|
|
|
<% if defined? classes and classes["description"] then %>
|
2003-12-01 02:12:49 -05:00
|
|
|
<description rd:parseType="Literal">
|
2008-01-07 05:40:50 -05:00
|
|
|
<%= classes["description"] %>
|
2003-12-01 02:12:49 -05:00
|
|
|
</description>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if defined? files and files["requires"] then %>
|
|
|
|
<% files["requires"].each do |requires| %>
|
|
|
|
<rd:required-file rd:name="<%= requires["name"] %>" />
|
|
|
|
<% end # files["requires"] %>
|
|
|
|
<% end %>
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 05:40:50 -05:00
|
|
|
<% if defined? classes and classes["includes"] then %>
|
|
|
|
<IncludedModuleList>
|
|
|
|
<% classes["includes"].each do |includes| %>
|
|
|
|
<included-module rd:name="<%= includes["name"] %>" />
|
|
|
|
<% end # includes["includes"] %>
|
|
|
|
</IncludedModuleList>
|
|
|
|
<% end %>
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 05:40:50 -05:00
|
|
|
<% if defined? classes and classes["sections"] then %>
|
|
|
|
<% classes["sections"].each do |sections| %>
|
|
|
|
<% if sections["attributes"] then %>
|
|
|
|
<% sections["attributes"].each do |attributes| %>
|
2003-12-01 02:12:49 -05:00
|
|
|
<contents>
|
2008-01-07 05:40:50 -05:00
|
|
|
<Attribute rd:name="<%= attributes["name"] %>">
|
|
|
|
<% if attributes["rw"] then %>
|
|
|
|
<attribute-rw><%= attributes["rw"] %></attribute-rw>
|
|
|
|
<% end %>
|
|
|
|
<description rdf:parseType="Literal"><%= attributes["a_desc"] %></description>
|
2003-12-01 02:12:49 -05:00
|
|
|
</Attribute>
|
|
|
|
</contents>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% end # sections["attributes"] %>
|
|
|
|
<% end %>
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 05:40:50 -05:00
|
|
|
<% if sections["method_list"] then %>
|
|
|
|
<% sections["method_list"].each do |method_list| %>
|
|
|
|
<% if method_list["methods"] then %>
|
|
|
|
<% method_list["methods"].each do |methods| %>
|
2003-12-01 02:12:49 -05:00
|
|
|
<contents>
|
2008-01-07 05:40:50 -05:00
|
|
|
<Method rd:name="<%= methods["name"] %>" rd:visibility="<%= methods["type"] %>"
|
|
|
|
rd:category="<%= methods["category"] %>" rd:id="<%= methods["aref"] %>">
|
|
|
|
<parameters><%= methods["params"] %></parameters>
|
|
|
|
<% if methods["m_desc"] then %>
|
2003-12-01 02:12:49 -05:00
|
|
|
<description rdf:parseType="Literal">
|
2008-01-07 05:40:50 -05:00
|
|
|
<%= methods["m_desc"] %>
|
2003-12-01 02:12:49 -05:00
|
|
|
</description>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% end %>
|
|
|
|
<% if methods["sourcecode"] then %>
|
2003-12-01 02:12:49 -05:00
|
|
|
<source-code-listing rdf:parseType="Literal">
|
2008-01-07 05:40:50 -05:00
|
|
|
<%= methods["sourcecode"] %>
|
2003-12-01 02:12:49 -05:00
|
|
|
</source-code-listing>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% end %>
|
2003-12-01 02:12:49 -05:00
|
|
|
</Method>
|
|
|
|
</contents>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% end # method_list["methods"] %>
|
|
|
|
<% end %>
|
|
|
|
<% end # sections["method_list"] %>
|
|
|
|
<% end %>
|
2003-12-01 02:12:49 -05:00
|
|
|
<!-- end method list -->
|
2008-01-07 05:40:50 -05:00
|
|
|
<% end # classes["sections"] %>
|
|
|
|
<% end %>
|
2008-01-12 22:02:49 -05:00
|
|
|
EOF
|
2003-12-01 02:12:49 -05:00
|
|
|
|
|
|
|
########################################################################
|
|
|
|
|
2008-01-12 22:02:49 -05:00
|
|
|
ONE_PAGE = %{<?xml version="1.0" encoding="utf-8"?>
|
2003-12-01 02:12:49 -05:00
|
|
|
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
|
|
xmlns="http://pragprog.com/rdoc/rdoc.rdf#"
|
|
|
|
xmlns:rd="http://pragprog.com/rdoc/rdoc.rdf#">
|
|
|
|
|
|
|
|
<!-- RDoc -->
|
2008-01-07 05:40:50 -05:00
|
|
|
<% values["files"].each do |files| %>
|
|
|
|
<rd:File rd:name="<%= files["short_name"] %>" rd:id="<%= files["href"] %>">
|
|
|
|
<path><%= files["full_path"] %></path>
|
|
|
|
<dtm-modified><%= files["dtm_modified"] %></dtm-modified>
|
2003-12-01 02:12:49 -05:00
|
|
|
} + CONTENTS_RDF + %{
|
|
|
|
</rd:File>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% end # values["files"] %>
|
|
|
|
<% values["classes"].each do |classes| %>
|
|
|
|
<<%= values["classmod"] %> rd:name="<%= classes["full_name"] %>" rd:id="<%= classes["full_name"] %>">
|
2003-12-01 02:12:49 -05:00
|
|
|
<classmod-info>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% if classes["infiles"] then %>
|
2003-12-01 02:12:49 -05:00
|
|
|
<InFiles>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% classes["infiles"].each do |infiles| %>
|
2003-12-01 02:12:49 -05:00
|
|
|
<infile>
|
2008-01-07 05:40:50 -05:00
|
|
|
<File rd:name="<%= infiles["full_path"] %>"
|
|
|
|
<% if infiles["full_path_url"] then %>
|
|
|
|
rdf:about="<%= infiles["full_path_url"] %>"
|
|
|
|
<% end %>
|
2003-12-01 02:12:49 -05:00
|
|
|
/>
|
|
|
|
</infile>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% end # classes["infiles"] %>
|
2003-12-01 02:12:49 -05:00
|
|
|
</InFiles>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% end %>
|
|
|
|
<% if classes["parent"] then %>
|
|
|
|
<superclass><%= href classes["par_url"], classes["parent"] %></superclass>
|
|
|
|
<% end %>
|
2003-12-01 02:12:49 -05:00
|
|
|
</classmod-info>
|
|
|
|
} + CONTENTS_RDF + %{
|
2008-01-07 05:40:50 -05:00
|
|
|
</<%= classes["classmod"] %>>
|
|
|
|
<% end # values["classes"] %>
|
2003-12-01 02:12:49 -05:00
|
|
|
<!-- /RDoc -->
|
|
|
|
</rdf:RDF>
|
|
|
|
}
|
|
|
|
|
|
|
|
end
|
|
|
|
|