Module: Marker

Defined in:
lib/marker.rb,
lib/marker/text.rb,
lib/marker/links.rb,
lib/marker/lists.rb,
lib/marker/common.rb,
lib/marker/markup.rb,
lib/marker/headings.rb,
lib/marker/verbatim.rb,
lib/marker/templates.rb

Overview

:nodoc:

Defined Under Namespace

Modules: DefaultTemplates Classes: Argument, Arguments, BlockArgument, Bold, Bulleted, Definition, Delimiter, Document, Escaped, ExternalLink, Footnotes, Heading, HorizRule, Indented, InlineArgument, InternalLink, Italic, ItemBuilder, List, ListBuilder, ListNode, Markup, Numbered, Paragraph, ParseNode, Phrase, Protocol, RecursiveList, Template, TextBlock, URL, Verbatim, VerbatimArea, Word

Class Method Summary collapse

Class Method Details

:nodoc:



52
53
54
# File 'lib/marker.rb', line 52

def link_base #:nodoc:
  @@link_base ||= ''
end

Sets the base url for internal links. If not set, internal links will begin with ‘/’



48
49
50
# File 'lib/marker.rb', line 48

def link_base=( url )
  @@link_base = url
end

.parse(markup) ⇒ Object

Parses the given markup string and returns the result



71
72
73
# File 'lib/marker.rb', line 71

def parse( markup )
  parser.parse( markup )
end

.parse_file(filename) ⇒ Object

Parses markup read from the file filename and returns the result



76
77
78
# File 'lib/marker.rb', line 76

def parse_file( filename )
  parser.parse( File.read( filename ) )
end

.parserObject

Returns a Marker markup parser instance (Marker::LanguageParser)



66
67
68
# File 'lib/marker.rb', line 66

def parser
  @@parser ||= LanguageParser.new
end

.render_optionsObject

:nodoc:



61
62
63
# File 'lib/marker.rb', line 61

def render_options #:nodoc:
  @@render_options ||= {}
end

.render_options=(options) ⇒ Object

sets the default options used when rendering markup



57
58
59
# File 'lib/marker.rb', line 57

def render_options=( options )
  @@render_options = options
end

.templatesObject

:nodoc:



42
43
44
# File 'lib/marker.rb', line 42

def templates #:nodoc:
  @@templates ||= Marker::DefaultTemplates
end

.templates=(mod) ⇒ Object

Adds the instance methods of mod to the templates that will be used when rendering text.

module Templates
  # defines {{ name }}
  def name( format, positional_array, named_hash )
    # return a string!
  end
end
Marker.templates = Templates


38
39
40
# File 'lib/marker.rb', line 38

def templates=( mod )
  @@templates = Marker::DefaultTemplates.extend( mod )
end