Module: VimwikiMarkdown

Defined in:
lib/vimwiki_markdown.rb,
lib/vimwiki_markdown/options.rb,
lib/vimwiki_markdown/version.rb,
lib/vimwiki_markdown/template.rb,
lib/vimwiki_markdown/exceptions.rb,
lib/vimwiki_markdown/vimwiki_link.rb

Defined Under Namespace

Classes: MissingRequiredParamError, Options, Template, VimwikiLink, WikiBody

Constant Summary collapse

VERSION =
"0.6.0"

Class Method Summary collapse

Class Method Details

.convert_wikimarkdown_to_htmlObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/vimwiki_markdown.rb', line 9

def self.convert_wikimarkdown_to_html
  ::I18n.enforce_available_locales = false

  options = Options.new
  template_html = Template.new(options)
  body_html = WikiBody.new(options)

  return if body_html.to_s =~ /%nohtml/

  combined_body_template = template_html.to_s.gsub('%content%', body_html.to_s)

  File.write(options.output_fullpath, combined_body_template)

rescue MissingRequiredParamError => e
  warn e.message
  exit(0)
end