Module: Markdown
- Defined in:
- lib/markdown.rb,
lib/markdown/config.rb,
lib/markdown/server.rb,
lib/markdown/cli/gen.rb,
lib/markdown/version.rb,
lib/markdown/wrapper.rb,
lib/markdown/cli/opts.rb,
lib/markdown/cli/runner.rb,
lib/markdown/engines/maruku.rb,
lib/markdown/engines/kramdown.rb,
lib/markdown/engines/bluecloth.rb,
lib/markdown/engines/rdiscount.rb,
lib/markdown/engines/redcarpet.rb,
lib/markdown/engines/pandoc_ruby.rb,
lib/markdown/engines/rpeg_markdown.rb
Defined Under Namespace
Modules: Engine
Classes: Config, Converter, Gen, Opts, Runner, Server, Wrapper
Constant Summary
collapse
- VERSION =
'1.1.1'
- @@config =
nil
Class Method Summary
collapse
Class Method Details
.banner ⇒ Object
version string for generator meta tag (includes ruby version)
51
52
53
|
# File 'lib/markdown.rb', line 51
def self.banner
"markdown #{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
end
|
.create_converter(lib) ⇒ Object
92
93
94
95
96
97
98
99
100
101
|
# File 'lib/markdown/wrapper.rb', line 92
def self.create_converter( lib )
if @@config.nil?
@@config = Config.new
end
mn_to_html = @@config.markdown_to_html_method( lib ) mn_version = @@config.markdown_version_method( lib )
Converter.new( lib, mn_to_html, mn_version )
end
|
.dump ⇒ Object
dump settings for debug/verbose flag
84
85
86
87
88
89
|
# File 'lib/markdown/wrapper.rb', line 84
def self.dump if @@config.nil?
@@config = Config.new
end
@@config.dump
end
|
.extnames ⇒ Object
70
71
72
73
74
75
|
# File 'lib/markdown/wrapper.rb', line 70
def self.extnames
if @@config.nil?
@@config = Config.new
end
@@config.markdown_extnames
end
|
.filters ⇒ Object
77
78
79
80
81
82
|
# File 'lib/markdown/wrapper.rb', line 77
def self.filters
if @@config.nil?
@@config = Config.new
end
@@config.markdown_filters
end
|
.lib ⇒ Object
56
57
58
59
60
61
|
# File 'lib/markdown/wrapper.rb', line 56
def self.lib
if @@config.nil?
@@config = Config.new
end
@@config.markdown_lib
end
|
.lib=(lib) ⇒ Object
49
50
51
52
53
54
|
# File 'lib/markdown/wrapper.rb', line 49
def self.lib=( lib )
if @@config.nil?
@@config = Config.new
end
@@config.markdown_lib = lib
end
|
.libs ⇒ Object
63
64
65
66
67
68
|
# File 'lib/markdown/wrapper.rb', line 63
def self.libs
if @@config.nil?
@@config = Config.new
end
@@config.markdown_libs
end
|
.main ⇒ Object
59
60
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/markdown.rb', line 59
def self.main
markdownopt = ENV[ 'MARKDOWNOPT' ]
args = []
args += markdownopt.split if markdownopt
args += ARGV.dup
Runner.new.run(args)
end
|
.new(content, options = {}) ⇒ Object
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
# File 'lib/markdown/wrapper.rb', line 104
def self.new( content, options={} )
options.keys.each do |key|
options[ key.to_s ] = options.delete(key)
end
if @@config.nil?
@@config = Config.new
end
lib = @@config.markdown_lib
mn = @@config.markdown_to_html_method( lib ) defaults = @@config.markdown_lib_defaults( lib )
props = Props.new( options, 'USER', Props.new( defaults, 'SYSTEM' ))
Wrapper.new( lib, mn, content, props )
end
|
.root ⇒ Object
55
56
57
|
# File 'lib/markdown.rb', line 55
def self.root
"#{File.expand_path( File.dirname(File.dirname(__FILE__)) )}"
end
|