Module: Deplate::Footnote

Defined in:
lib/deplate/etc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#accumObject (readonly)

Quack like Deplate::Region



82
83
84
# File 'lib/deplate/etc.rb', line 82

def accum
  @accum
end

#captionObject (readonly)

Quack like Deplate::Region



82
83
84
# File 'lib/deplate/etc.rb', line 82

def caption
  @caption
end

#captionOptionsObject (readonly)

Quack like Deplate::Region



82
83
84
# File 'lib/deplate/etc.rb', line 82

def captionOptions
  @captionOptions
end

#fnIdObject (readonly)

Returns the value of attribute fnId.



80
81
82
# File 'lib/deplate/etc.rb', line 80

def fnId
  @fnId
end

#labelObject (readonly)

Quack like Deplate::Region



82
83
84
# File 'lib/deplate/etc.rb', line 82

def label
  @label
end

#levelObject (readonly)

Quack like Deplate::Region



82
83
84
# File 'lib/deplate/etc.rb', line 82

def level
  @level
end

#regNoteObject (readonly)

Quack like Deplate::Region



82
83
84
# File 'lib/deplate/etc.rb', line 82

def regNote
  @regNote
end

Instance Method Details

#footnote_processObject



105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/deplate/etc.rb', line 105

def footnote_process
    fn = @deplate.footnotes[@fnId]
    if fn
        # fn.elt.consumed = true
        fn.fn_consumed = true
        @elt = fn
    else
        log(['Unknown footnote', @fnId, @deplate.footnotes.keys.inspect], :error)
        @elt = nil
    end
    return format_particle(:format_footnote, self)
end

#footnote_setup(text) ⇒ Object



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/deplate/etc.rb', line 84

def footnote_setup(text)
    if text
        @fnId = @args['id']
        if @fnId and text and !text.empty?
            # @regNote = @fnId
            @accum   = text
            # @level   = @container.level
            fn = Deplate::Regions::Footnote.new(@deplate, @source, @fnId, {}, self)
            fn.finish
            fn.elt.each {|e| e.args[:minor] = true}
        else
            @fnId ||= text
        end
        if @container.kind_of?(Deplate::Element::Table)
            @container.contains_footnotes = true
        end
    else
        log('No footnote ID', :error)
    end
end