Start from here


Markascend语法简介

  1. Compile
    1. compile api
  2. Options
  3. Customizing macros
  4. Customizing line-unit parsers

Compile

Markascend.compile src, options

compile api

Options


Customizing macros

More macro processors can be added by

class Markascend::Macro
  def parse_fancy_macro
    ... compose result string with: env, content, inline
  end
end

Macro names are limited to names like ruby methods.

Markascend.compile src, macros: %w[fancy_macro del]

Customizing line-unit parsers

More line-unit parsers can be added by

class Markascend::LineUnit
  def parse_at
    ... compose result string with: env, line, block, linenum
  end
end

The list of inline parsers can be changed, or reordered

Markascend.compile src, line_units: Markascend::DEFAULT_LINE_UNITS + %w[at]