Class: Docgenerator::Creole::Plugins::Creole_footnote
- Inherits:
-
Creole_inclusion_and_plugin
- Object
- Creole_inclusion_and_plugin
- Docgenerator::Creole::Plugins::Creole_footnote
- 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
Instance Method Summary collapse
-
#initialize(inclusionname, description, options, wiki) ⇒ Creole_footnote
constructor
A new instance of Creole_footnote.
- #to_doc(target, options = {}) ⇒ Object
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, , wiki ) super @groupid = Footnotegroup::DEFAULTGROUPID label = nil .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, ={}) @footnote.to_doc(target, ) end |