Class: HikiDoc
- Inherits:
-
Object
- Object
- HikiDoc
- Defined in:
- lib/hikidoc.rb
Defined Under Namespace
Classes: Error, HTMLOutput, LineInput, UnexpectedError
Constant Summary collapse
- VERSION =
"0.1.0"
Class Method Summary collapse
Instance Method Summary collapse
- #compile(src) ⇒ Object
-
#initialize(output, options = {}) ⇒ HikiDoc
constructor
A new instance of HikiDoc.
-
#to_html ⇒ Object
for backward compatibility.
Constructor Details
#initialize(output, options = {}) ⇒ HikiDoc
Returns a new instance of HikiDoc.
57 58 59 60 61 62 63 |
# File 'lib/hikidoc.rb', line 57 def initialize(output, = {}) @output = output @options = .merge() @header_re = nil @level = [:level] || 1 @plugin_syntax = [:plugin_syntax] || method(:valid_plugin_syntax?) end |
Class Method Details
.to_html(src, options = {}) ⇒ Object
49 50 51 |
# File 'lib/hikidoc.rb', line 49 def HikiDoc.to_html(src, = {}) new(HTMLOutput.new(">"), ).compile(src) end |
.to_xhtml(src, options = {}) ⇒ Object
53 54 55 |
# File 'lib/hikidoc.rb', line 53 def HikiDoc.to_xhtml(src, = {}) new(HTMLOutput.new(" />"), ).compile(src) end |
Instance Method Details
#compile(src) ⇒ Object
65 66 67 68 69 70 71 |
# File 'lib/hikidoc.rb', line 65 def compile(src) @output.reset escape_plugin_blocks(src) {|escaped| compile_blocks escaped @output.finish } end |
#to_html ⇒ Object
for backward compatibility
74 75 76 77 |
# File 'lib/hikidoc.rb', line 74 def to_html $stderr.puts("warning: HikiDoc#to_html is deprecated. Please use HikiDoc.to_html or HikiDoc.to_xhtml instead.") self.class.to_html(@output, @options) end |