Class RDoc::TemplatePage
In: lib/rdoc/template.rb
Parent: Object
CodeObject Include Context Alias Attr AnyMethod Constant Require ClassModule NormalModule SingleClass AnonClass NormalClass TopLevel RubyParser RubyToken RuntimeError Error Error AttributeFormatter AnsiFormatter OverstrikeFormatter HtmlFormatter DefaultDisplay NamedThing IncludedModule Attribute Constant MethodSummary AliasName ClassEntry TopLevelEntry Description MethodDescription ModuleDescription ClassDescription Formatter SimpleFormatter HTML HTMLInOne XML CHM Context Method Class File Element Edge Node Subgraph Digraph SimpleElement Port Options Diagram Fortran95parser RDoc SimpleParser Token Markup TemplatePage Stats C_Parser NameDescriptor Cache Reader Writer Driver MethodEntry RI AllReferences Display Paths RI MarkUp Generator TokenStream ParserFactory DOT RDoc dot/f_4.png

An ERb wrapper that allows nesting of one ERb template inside another.

This TemplatePage operates similarly to RDoc 1.x‘s TemplatePage, but uses ERb instead of a custom template language.

Converting from a RDoc 1.x template to an RDoc 2.x template is fairly easy.

  • %blah% becomes <%= values["blah"] %>
  • !INCLUDE! becomes <%= template_include %>
  • HREF:aref:name becomes <%= href values["aref"], values["name"] %>
  • IF:blah becomes <% if values["blah"] then %>
  • IFNOT:blah becomes <% unless values["blah"] then %>
  • ENDIF:blah becomes <% end %>
  • START:blah becomes <% values["blah"].each do |blah| %>
  • END:blah becomes <% end %>

To make nested loops easier to convert, start by converting START statements to:

  <% values["blah"].each do |blah| $stderr.puts blah.keys %>

So you can see what is being used inside which loop.

Methods

href   new   write_html_on  

Public Class methods

Create a new TemplatePage that will use templates.

Public Instance methods

Returns "<a href=\"#{ref}\">#{name}</a>"

Process the template using values, writing the result to io.

[Validate]