class VimwikiMarkdown::Template
Attributes
Public Class Methods
Source
# File lib/vimwiki_markdown/template.rb, line 7 def initialize(options) @options = options get_template_contents validate_template end
Public Instance Methods
Private Instance Methods
Source
# File lib/vimwiki_markdown/template.rb, line 61 def dark_template? @template =~ /%dark_pygments%/ end
Source
# File lib/vimwiki_markdown/template.rb, line 23 def get_template_contents file = File.open(options.template_filename, "r") @template = file.read end
Source
# File lib/vimwiki_markdown/template.rb, line 57 def pygments_marker dark_template? ? "%dark_pygments%" : "%pygments%" end
Source
# File lib/vimwiki_markdown/template.rb, line 65 def regular_template? @template =~ /%pygments%/ end
Source
# File lib/vimwiki_markdown/template.rb, line 43 def root_path options.root_path end
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