lib/soywiki.rb in soywiki-0.7.0 vs lib/soywiki.rb in soywiki-0.7.1

- old
+ new

@@ -1,9 +1,9 @@ require 'string_ext' module Soywiki - VERSION = '0.7.0' + VERSION = '0.7.1' WIKI_WORD = /\b([a-z][\w_]+\.)?[A-Z][a-z]+[A-Z]\w*\b/ HYPERLINK = %r|\bhttps?://[^ >)\n\]]+| def self.run if %W( -v --version -h --help).include?(ARGV.first) @@ -20,11 +20,17 @@ called main/HomePage. --- END exit elsif ARGV.first == '--html' - self.html_export + if ARGV[1] == '--markdown' + puts "Exporting html using markdown" + self.html_export(true) + else + puts "Exporting html" + self.html_export + end exit elsif ARGV.first == '--install-plugin' require 'erb' plugin_template = File.read(File.join(File.dirname(__FILE__), 'plugin.erb')) vimscript_file = File.join(File.dirname(__FILE__), 'soywiki.vim') @@ -37,12 +43,12 @@ vim_command = "#{vim} -S #{vimscript}" exec vim_command end end - def self.html_export + def self.html_export(markdown=false) require 'soywiki/html' - Html.export + Html.export(markdown) end end if __FILE__ == $0 Soywiki.run