Module: Markdown
- Defined in:
- lib/markdown/config.rb,
lib/markdown/version.rb,
lib/markdown/wrapper.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, Wrapper
Constant Summary
collapse
- MAJOR =
1
- MINOR =
2
- PATCH =
1
- VERSION =
[MAJOR,MINOR,PATCH].join('.')
- @@config =
nil
Class Method Summary
collapse
Class Method Details
.banner ⇒ Object
version string for generator meta tag (includes ruby version)
16
17
18
|
# File 'lib/markdown/version.rb', line 16
def self.banner
"markdown/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] in (#{root})"
end
|
.create_converter(lib) ⇒ Object
94
95
96
97
98
99
100
101
102
103
|
# File 'lib/markdown/wrapper.rb', line 94
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
86
87
88
89
90
91
|
# File 'lib/markdown/wrapper.rb', line 86
def self.dump if @@config.nil?
@@config = Config.new
end
@@config.dump
end
|
.extnames ⇒ Object
72
73
74
75
76
77
|
# File 'lib/markdown/wrapper.rb', line 72
def self.extnames
if @@config.nil?
@@config = Config.new
end
@@config.markdown_extnames
end
|
.filters ⇒ Object
79
80
81
82
83
84
|
# File 'lib/markdown/wrapper.rb', line 79
def self.filters
if @@config.nil?
@@config = Config.new
end
@@config.markdown_filters
end
|
.lib ⇒ Object
58
59
60
61
62
63
|
# File 'lib/markdown/wrapper.rb', line 58
def self.lib
if @@config.nil?
@@config = Config.new
end
@@config.markdown_lib
end
|
.lib=(lib) ⇒ Object
51
52
53
54
55
56
|
# File 'lib/markdown/wrapper.rb', line 51
def self.lib=( lib )
if @@config.nil?
@@config = Config.new
end
@@config.markdown_lib = lib
end
|
.libs ⇒ Object
65
66
67
68
69
70
|
# File 'lib/markdown/wrapper.rb', line 65
def self.libs
if @@config.nil?
@@config = Config.new
end
@@config.markdown_libs
end
|
.new(content, options = {}) ⇒ Object
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
132
133
|
# File 'lib/markdown/wrapper.rb', line 106
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
20
21
22
|
# File 'lib/markdown/version.rb', line 20
def self.root
File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
end
|
.version ⇒ Object
10
11
12
|
# File 'lib/markdown/version.rb', line 10
def self.version
VERSION
end
|