class VimwikiMarkdown::Options
Constants
- CSS_FILE
- DEFAULTS
- EXTENSION
- FORCE
- INPUT_FILE
- OUTPUT_DIR
- ROOT_PATH
- SYNTAX
- TEMPLATE_DEFAULT
- TEMPLATE_EXT
- TEMPLATE_PATH
Attributes
Public Class Methods
Source
# File lib/vimwiki_markdown/options.rb, line 64 def self.arguments ARGV.empty? ? DEFAULTS : ARGV end
Source
# File lib/vimwiki_markdown/options.rb, line 45 def initialize @force = arguments[FORCE] == "1" ? true : false @syntax = arguments[SYNTAX] @extension = ".#{arguments[EXTENSION]}" @output_dir = arguments[OUTPUT_DIR] @input_file = arguments[INPUT_FILE] @css_file = arguments[CSS_FILE] @template_path = arguments[TEMPLATE_PATH] @template_default = arguments[TEMPLATE_DEFAULT] @template_ext = arguments[TEMPLATE_EXT] @root_path = arguments[ROOT_PATH] @root_path = "./" if @root_path == "-" raise "Must be markdown" unless syntax == 'markdown' end
syntax : the syntax chosen for this wiki extension : the file extension for this wiki output_dir
: the full path of the output directory, i.e. ‘path_html’ input_file
: the full path of the wiki page css_file
: the full path of the css file for this wiki template_path
: the full path to the wiki’s templates template_default
: the default template name template_ext
: the extension of template files root_path
: a count of ../ for pages buried in subdirs
if you have wikilink [[dir1/dir2/dir3/my page in a subdir]] then e %root_path% is replaced by '../../../'.
Public Instance Methods
Source
# File lib/vimwiki_markdown/options.rb, line 72 def output_fullpath filename = title.parameterize =~ /^\s*$/ ? title : title.parameterize "#{output_dir}#{filename}.html" end
Source
# File lib/vimwiki_markdown/options.rb, line 60 def template_filename "#{template_path}#{template_default}#{template_ext}" end
Source
# File lib/vimwiki_markdown/options.rb, line 68 def title File.basename(input_file, "#{extension}").capitalize end
Private Instance Methods
Source
# File lib/vimwiki_markdown/options.rb, line 80 def arguments Options.arguments end