Class: Docgenerator::Creole::Plugins::Creole_footnote

Inherits:
Creole_inclusion_and_plugin show all
Defined in:
lib/docgenerator/creole/plugins.rb

Overview

One footnote

Usage:

<<footnote|text>>
<<footnote|text|label=l1>>
<<footnote|text|groupid=g1>>

Bug: If you create more documents, you get a common footnote counting.

Solution:

  • LaTeX: no problem, LaTeX has it’s own output mechanism.

  • HTML: Use grouping.

Instance Attribute Summary

Attributes inherited from Creole_inclusion_and_plugin

#wiki

Instance Method Summary collapse

Methods inherited from Creole_inclusion_and_plugin

set_inclusions_key, set_plugin_key

Constructor Details

#initialize(inclusionname, description, options, wiki) ⇒ Creole_footnote

Returns a new instance of Creole_footnote.



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/docgenerator/creole/plugins.rb', line 97

def initialize( inclusionname, description, options, wiki )
  super
  
  @groupid = Footnotegroup::DEFAULTGROUPID
  label = nil
  
  options.each{|option|
    case option
      when /label\s*=\s*(.*)/
        label = $1
      when /groupid\s*=\s*(.*)/
        @groupid = $1
      else
      @wiki.log.warn("Footnote with unknown option #{option.inspect} not found") if @wiki.log.warn?
    end
  }
  
  if ! wiki.footnotegroups[@groupid]
    wiki.footnotegroups[@groupid] = Footnotegroup.new(@groupid)
  end

  group = wiki.footnotegroups[@groupid]
  
  @footnote = element(:footnote,{ 
    :group => group,
    :label => label,
    }, description )
  
  
end

Instance Method Details

#to_doc(target, options = {}) ⇒ Object



127
128
129
# File 'lib/docgenerator/creole/plugins.rb', line 127

def to_doc(target, options ={})
  @footnote.to_doc(target, options)
end