This class is a specialized RichTextFunctionHandler that turns references to TJP example code in the test/TestSuite/Syntax/Correct directory into embedded example code. It currently only supports HTML.
Return a XMLElement tree that represents the example file as HTML code.
# File lib/RichTextFunctionExample.rb, line 36 36: def to_html(args) 37: unless (file = args['file']) 38: raise "'file' argument missing" 39: end 40: tag = args['tag'] 41: 42: example = TjpExample.new 43: fileName = AppConfig.dataDirs('test')[0] + 44: "TestSuite/Syntax/Correct/#{file}.tjp" 45: example.open(fileName) 46: frame = XMLElement.new('div', 'class' => 'codeframe') 47: frame << (pre = XMLElement.new('pre', 'class' => 'code')) 48: unless (text = example.to_s(tag)) 49: raise "There is no tag '#{tag}' in file " + 50: "#{fileName}." 51: end 52: pre << XMLText.new(text) 53: frame 54: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.