class VimwikiMarkdown::Template
Attributes
options[R]
template[R]
Public Class Methods
new(options)
click to toggle source
# File lib/vimwiki_markdown/template.rb, line 7 def initialize(options) @options = options get_template_contents validate_template end
Public Instance Methods
to_s()
click to toggle source
# File lib/vimwiki_markdown/template.rb, line 14 def to_s fixtags(template) end
Private Instance Methods
dark_template?()
click to toggle source
# File lib/vimwiki_markdown/template.rb, line 61 def dark_template? @template =~ /%dark_pygments%/ end
get_template_contents()
click to toggle source
# File lib/vimwiki_markdown/template.rb, line 23 def get_template_contents file = File.open(options.template_filename, "r") @template = file.read end
pygments_marker()
click to toggle source
# File lib/vimwiki_markdown/template.rb, line 57 def pygments_marker dark_template? ? "%dark_pygments%" : "%pygments%" end
regular_template?()
click to toggle source
# File lib/vimwiki_markdown/template.rb, line 65 def regular_template? @template =~ /%pygments%/ end
root_path()
click to toggle source
# File lib/vimwiki_markdown/template.rb, line 43 def root_path options.root_path end
title()
click to toggle source
# File lib/vimwiki_markdown/template.rb, line 47 def title options.title end
validate_template()
click to toggle source
# File lib/vimwiki_markdown/template.rb, line 51 def validate_template return if dark_template? || regular_template? raise MissingRequiredParamError.new("ERROR: vimwiki template must contain %pygments% placeholder token. Please visit https://github.com/patrickdavey/vimwiki_markdown for more information") end