Class: HikiDoc

Inherits:
Object
  • Object
show all
Defined in:
lib/vendor/hikidoc.rb

Direct Known Subclasses

PikiDoc::Document

Defined Under Namespace

Classes: Error, HTMLOutput, LineInput, UnexpectedError

Constant Summary collapse

VERSION =

FIXME

"0.0.4"

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output, options = {}) ⇒ HikiDoc

Returns a new instance of HikiDoc.



56
57
58
59
60
61
62
# File 'lib/vendor/hikidoc.rb', line 56

def initialize(output, options = {})
  @output = output
  @options = default_options.merge(options)
  @header_re = nil
  @level = options[:level] || 1
  @plugin_syntax = options[:plugin_syntax] || method(:valid_plugin_syntax?)
end

Class Method Details

.to_html(src, options = {}) ⇒ Object



48
49
50
# File 'lib/vendor/hikidoc.rb', line 48

def HikiDoc.to_html(src, options = {})
  new(HTMLOutput.new(">"), options).compile(src)
end

.to_xhtml(src, options = {}) ⇒ Object



52
53
54
# File 'lib/vendor/hikidoc.rb', line 52

def HikiDoc.to_xhtml(src, options = {})
  new(HTMLOutput.new(" />"), options).compile(src)
end

Instance Method Details

#compile(src) ⇒ Object



64
65
66
67
68
69
70
# File 'lib/vendor/hikidoc.rb', line 64

def compile(src)
  @output.reset
  escape_plugin_blocks(src) {|escaped|
    compile_blocks escaped
    @output.finish
  }
end

#to_htmlObject

for backward compatibility



73
74
75
76
# File 'lib/vendor/hikidoc.rb', line 73

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