Module Kramdown::Options
In: lib/kramdown/options.rb

This module defines all options that are used by parsers and/or converters as well as providing methods to deal with the options.

Methods

Classes and Modules

Class Kramdown::Options::Boolean

Option definitions

This sections describes the methods that can be used on the Options module.

Constants

Definition = Struct.new(:name, :type, :default, :desc, :validator)   Struct class for storing the definition of an option.
ALLOWED_TYPES = [String, Integer, Float, Symbol, Boolean, Object]   Allowed option types.

Public Class methods

Return a Hash with the default values for all options.

Define a new option called name (a Symbol) with the given type (String, Integer, Float, Symbol, Boolean, Object), default value default and the description desc. If a block is specified, it should validate the value and either raise an error or return a valid value.

The type ‘Object’ should only be used for complex types for which none of the other types suffices. A block needs to be specified when using type ‘Object’ and it has to cope with a value given as string and as the opaque type.

Return true if an option called name is defined.

Return all option definitions.

Merge the defaults Hash with the parsed options from the given Hash, i.e. only valid option names are considered and their value is run through the parse method.

Parse the given value data as if it was a value for the option name and return the parsed value with the correct type.

If data already has the correct type, it is just returned. Otherwise it is converted to a String and then to the correct type.

Option Validators

This sections contains all pre-defined option validators.

Public Class methods

Ensures that the option value val for the option called name is a valid array. The parameter val can be

  • a comma separated string which is split into an array of values
  • or an array.

Additionally, the array is checked for the correct size.

Option Definitions

This sections contains all option definitions that are used by the included parsers/converters.