module Markdown
Constants
- MAJOR
- MINOR
- PATCH
- VERSION
Public Class Methods
create_converter( lib )
click to toggle source
# 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 ) # lets you use differnt options/converters for a single markdown lib mn_version = @@config.markdown_version_method( lib ) Converter.new( lib, mn_to_html, mn_version ) end
dump()
click to toggle source
# File lib/markdown/wrapper.rb, line 86 def self.dump # dump settings for debug/verbose flag if @@config.nil? @@config = Config.new end @@config.dump end
extnames()
click to toggle source
# File lib/markdown/wrapper.rb, line 72 def self.extnames if @@config.nil? @@config = Config.new end @@config.markdown_extnames end
filters()
click to toggle source
# File lib/markdown/wrapper.rb, line 79 def self.filters if @@config.nil? @@config = Config.new end @@config.markdown_filters end
lib()
click to toggle source
# File lib/markdown/wrapper.rb, line 58 def self.lib if @@config.nil? @@config = Config.new end @@config.markdown_lib end
lib=( lib )
click to toggle source
# File lib/markdown/wrapper.rb, line 51 def self.lib=( lib ) if @@config.nil? @@config = Config.new end @@config.markdown_lib = lib end
libs()
click to toggle source
# File lib/markdown/wrapper.rb, line 65 def self.libs if @@config.nil? @@config = Config.new end @@config.markdown_libs end
new( content, options={} )
click to toggle source
# File lib/markdown/wrapper.rb, line 106 def self.new( content, options={} ) ## options ## make sure keys are strings, that is, allow symbols for easy use ## but internally only use string (yaml gets use strings) ## fix: use stringify_keys! from activesupport (include dependency ?? why? why not??) options.keys.each do |key| options[ key.to_s ] = options.delete(key) end ## todo: allow options to pass in ## lets you change markdown engine/converter for every call ## e.g. lets you add config properties (as headers) to your document (for example) if @@config.nil? @@config = Config.new end lib = @@config.markdown_lib mn = @@config.markdown_to_html_method( lib ) # lets you use differnt options/converters for a single markdown lib defaults = @@config.markdown_lib_defaults( lib ) ## todo/fix: use mn / converter from defaults hash?? mn no longer needed?? props = Props.new( options, 'USER', Props.new( defaults, 'SYSTEM' )) Wrapper.new( lib, mn, content, props ) end
root()
click to toggle source
# File lib/markdown/version.rb, line 20 def self.root "#{File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )}" end
version()
click to toggle source
# File lib/markdown/version.rb, line 10 def self.version VERSION end