Class: Docgenerator::Creole::Placeholder
- Inherits:
-
Object
- Object
- Docgenerator::Creole::Placeholder
- Defined in:
- lib/docgenerator/creole/placeholder.rb
Overview
Placeholder are defined in Creole-Syntax via <<< >>>
Placeholders get a name and optional parameters:
<<<name|parameter
Placeholders collect the content between <<< and >>>.
Derived classes are:
-
Creole::Placeholders::Dummy
-
Creole::Placeholders::Html
-
Creole::Placeholders::Latex
-
Creole::Creole_tabular
-
Creole::Creole_tab
Direct Known Subclasses
Creole_structogramm, Creole_tab, Creole_tabular, Creole_tabular_csv, Docgenerator::Creole::Placeholders::Creole_comment, Docgenerator::Creole::Placeholders::Creole_figure, Docgenerator::Creole::Placeholders::Creole_html, Docgenerator::Creole::Placeholders::Creole_latex, Docgenerator::Creole::Placeholders::Dummy, Docgenerator::Creole::Placeholders::Tikz_img, Rail::Diagramm4Creole, Rubycode::Code, Rubycode::Code_evaluated, Rubycode::Code_evaluated_listings, Rubycode::Code_in_tab, Rubycode::Code_output
Defined Under Namespace
Classes: ParameterError
Class Method Summary collapse
-
.set_placeholder_key(key) ⇒ Object
Define class as a placeholder.
Instance Method Summary collapse
-
#<<(content) ⇒ Object
Add the content between <<< and >>>.
-
#close ⇒ Object
Possibility to analyse the content.
-
#initialize(wiki, parameters = nil) ⇒ Placeholder
constructor
Each placeholder get the wiki where it belongs to.
-
#to_doc(target, options = {}) ⇒ Object
Export it.
Constructor Details
#initialize(wiki, parameters = nil) ⇒ Placeholder
Each placeholder get the wiki where it belongs to.
Parameters is an optional string.
Definition inside the wiki:
<<<name|parameters
content
>>>
Placeholders collect the content between <<< and >>>.
47 48 49 50 51 |
# File 'lib/docgenerator/creole/placeholder.rb', line 47 def initialize( wiki, parameters = nil) @wiki = wiki @parameters = parameters @log = @wiki.log end |
Class Method Details
.set_placeholder_key(key) ⇒ Object
Define class as a placeholder. You may use the class as:
{{key}}
29 30 31 |
# File 'lib/docgenerator/creole/placeholder.rb', line 29 def set_placeholder_key(key) Placeholders::Collection[key] = self end |
Instance Method Details
#<<(content) ⇒ Object
Add the content between <<< and >>>.
54 55 56 57 |
# File 'lib/docgenerator/creole/placeholder.rb', line 54 def << (content) @source = [] unless @source @source << content end |
#close ⇒ Object
Possibility to analyse the content.
60 61 62 |
# File 'lib/docgenerator/creole/placeholder.rb', line 60 def close() @source.freeze end |
#to_doc(target, options = {}) ⇒ Object
Export it. Should be redefined by sub classes.
64 65 66 |
# File 'lib/docgenerator/creole/placeholder.rb', line 64 def to_doc( target, = {}) @source.to_doc( target, ) end |