# File lib/doc_book_printer.rb, line 42 def do_finish @xml << "</appendix>\n" puts "Written #{@index.path}" @index.close end
# File lib/doc_book_printer.rb, line 23 def do_prepare unless File.exists? @output_dir Dir.mkdir @output_dir end @index = File.new @output_dir + "/rest_api_appendix.xml", "w" @xml = Builder::XmlMarkup.new :target => @index, :indent => 2 @xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8" @xml.declare! :DOCTYPE, :appendix, :PUBLIC, "-//Novell//DTD NovDoc XML V1.0//EN", "novdocx.dtd" do |x| x.declare! :ENTITY, :%, :'NOVDOC.DEACTIVATE.IDREF', "IGNORE" x.declare! :ENTITY, :%, :entities, :SYSTEM, "entity-decl.ent" x << " %entities;\n" end @xml.comment! "This file was generated by restility at #{Time.now}" @xml << "<appendix xml:base=\"rest_api_appendix.xml\" id=\"app.rest_api_doc\">\n" end
# File lib/doc_book_printer.rb, line 122 def print_body body @xml.para "Body: #{body.name}" end
# File lib/doc_book_printer.rb, line 149 def print_contents contents # empty, the content is generated by docbook itself @xml.para end
# File lib/doc_book_printer.rb, line 114 def print_host host @xml.para "Host: " + host.name end
# File lib/doc_book_printer.rb, line 111 def print_parameter parameter end
# File lib/doc_book_printer.rb, line 68 def print_request request @xml.variablelist do @xml.varlistentry do @xml.term do @xml.literal request.to_s end @xml.listitem do request.parameters.each do |p| @xml.para do @xml.emphasis p.name @xml << " (optional)" if p.optional @xml << " - #{p.description}" if p.description && !p.description.empty? end end request.print_children self end end end end
# File lib/doc_book_printer.rb, line 118 def print_result result @xml.para "Result: #{result.name}" end
# File lib/doc_book_printer.rb, line 48 def print_section section if !section.root? level = section.level - 1 if level.zero? @xml.title section @xml.para section.print_children self else @xml.tag! "sect#{level}", "id" => "app.rest_api_doc.sect#{level}.#{@section}" do @section += 1 @xml.title section section.print_children self end end else section.print_children self end end
# File lib/doc_book_printer.rb, line 102 def print_text text @xml.para do |p| text.text.each do |t| replace_html_tags t p << t << "\n" end end end
# File lib/doc_book_printer.rb, line 154 def print_version version @xml.para "API Version: #{version}" end
# File lib/doc_book_printer.rb, line 134 def print_xml_links xmlname, schema example = xmlname + ".xml" if !schema || schema.empty? schema = xmlname + ".xsd" end if XmlFile.exist? example @xml.screen File.read(XmlFile.find_file example) end if XmlFile.exist? schema @xml.screen File.read(XmlFile.find_file schema) end end
Generated with the Darkfish Rdoc Generator 2.