Class Index [+]

Quicksearch

TaskJuggler::RichTextFunctionExample

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.

Public Class Methods

new() click to toggle source
    # File lib/RichTextFunctionExample.rb, line 25
25:     def initialize
26:       super(nil, 'example')
27:       @blockFunction = true
28:     end

Public Instance Methods

to_html(args) click to toggle source

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
to_s(args) click to toggle source

Not supported for this function

    # File lib/RichTextFunctionExample.rb, line 31
31:     def to_s(args)
32:       ''
33:     end
to_tagged(args) click to toggle source

Not supported for this function.

    # File lib/RichTextFunctionExample.rb, line 57
57:     def to_tagged(args)
58:       nil
59:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.