Sha256: 989e544fad3eebce8066f297ce143c307e432c9e729b05767df0821f7e456626

Contents?: true

Size: 1021 Bytes

Versions: 54

Compression:

Stored size: 1021 Bytes

Contents

require 'webgen/tag'
class RdocLinks
    include Webgen::Tag::Base

    def call(tag, body, context)
        name = param('rdoclinks.name')
        if base_module = param('rdoclinks.base_module')
            name = base_module + "::" + name
        end

        if name =~ /(?:\.|#)(\w+)$/
            class_name  = $` 
            method_name = $1
        else
            class_name = name
        end

        path = class_name.split('::')
        path[-1] += ".html"
        url = "#{param('rdoclinks.base_url')}/#{path.join("/")}"

        "<a href=\"#{context.ref_node.route_to(url)}\">#{param('rdoclinks.name')}</a>"
    end
end

config = Webgen::WebsiteAccess.website.config
config.rdoclinks.name        "", :mandatory => 'default'
config.rdoclinks.base_webgen "", :mandatory => false
config.rdoclinks.base_url    "", :mandatory => false
config.rdoclinks.base_module nil, :mandatory => false
config.rdoclinks.full_name   false, :mandatory => false
config['contentprocessor.tags.map']['rdoc_class'] = 'RdocLinks'

Version data entries

54 entries across 54 versions & 2 rubygems

Version Path
autoproj-1.7.0.rc2 doc/guide/ext/rdoc_links.rb
autoproj-1.7.0.rc1 doc/guide/ext/rdoc_links.rb
autoproj-1.7.0.b3 doc/guide/ext/rdoc_links.rb
autoproj-1.7.0.b2 doc/guide/ext/rdoc_links.rb
autoproj-1.7.0.b1 doc/guide/ext/rdoc_links.rb
autoproj-1.6.2 doc/guide/ext/rdoc_links.rb
autoproj-1.6.2.rc9 doc/guide/ext/rdoc_links.rb
autoproj-1.6.2.rc8 doc/guide/ext/rdoc_links.rb
autoproj-1.6.2.rc7 doc/guide/ext/rdoc_links.rb
autoproj-1.6.2.rc6 doc/guide/ext/rdoc_links.rb
autoproj-1.6.2.rc5 doc/guide/ext/rdoc_links.rb
autoproj-1.6.2.rc4 doc/guide/ext/rdoc_links.rb
autoproj-1.6.2.rc3 doc/guide/ext/rdoc_links.rb
autoproj-1.6.2.rc2 doc/guide/ext/rdoc_links.rb
autoproj-1.6.1 doc/guide/ext/rdoc_links.rb
autoproj-1.6.1.b1 doc/guide/ext/rdoc_links.rb
autoproj-1.6.0 doc/guide/ext/rdoc_links.rb
autoproj-1.6.0.rc6 doc/guide/ext/rdoc_links.rb
autoproj-1.6.0.rc5 doc/guide/ext/rdoc_links.rb
autoproj-1.6.0.rc4 doc/guide/ext/rdoc_links.rb