Class: Deplate::Macro::RefLinkMap

Inherits:
Ref
  • Object
show all
Defined in:
lib/deplate/mod/linkmap.rb

Overview

access a link stored with LinkMap region

Example News == news.example.com/

Instance Method Summary collapse

Instance Method Details

#processObject



86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/deplate/mod/linkmap.rb', line 86

def process
    if @text
        ref = Deplate::LinkMap.get(@current_source_id, @text)
        if ref
            prefix = @args['prefix'] || @deplate.formatter.plain_text(' ', true)
            name = @args['p'] ? @deplate.formatter.plain_text(ref) : @deplate.parse_and_format(self, @args['name'] || @text)
            url  = format_particle(:format_url, self, name, ref, nil)
            # url  = @deplate.parse_and_format(self, ref)
            return [prefix, url].join
        end
    end
    super
end

#setup(text) ⇒ Object



81
82
83
84
# File 'lib/deplate/mod/linkmap.rb', line 81

def setup(text)
    @current_source_id = @deplate.current_source.object_id
    super
end