Method: RDoc::Servlet#show_documentation

Defined in:
lib/rdoc/servlet.rb

#show_documentation(req, res) ⇒ Object

Displays documentation for req on res, whether that be HTML or some asset.



395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# File 'lib/rdoc/servlet.rb', line 395

def show_documentation req, res
  store, path = documentation_source req.path

  if_modified_since req, res, store.cache_path

  generator = generator_for store

  case path
  when nil, '', 'index.html' then
    res.body = generator.generate_index
  when 'table_of_contents.html' then
    res.body = generator.generate_table_of_contents
  when 'js/search_index.js' then
    documentation_search store, generator, req, res
  else
    documentation_page store, generator, path, req, res
  end
ensure
  res.content_type ||= 'text/html'
end