View Source Md.Parser.Syntax behaviour (md v0.7.4)

The behaviour for the custom syntax suppliers

Link to this section Summary

Types

Syntax item definition

Settings for the parser

t()

Syntax definition

Callbacks

The implementation should return settings for this particular syntax definition

The implementation should return a syntax definition

Functions

List of different types of markup

Link to this section Types

@type item() :: {binary(), map()}

Syntax item definition

@type settings() :: %{
  optional(:outer) => atom(),
  optional(:span) => atom(),
  optional(:disclosure_range) => Range.t(),
  optional(:empty_tags) => [atom()]
}

Settings for the parser

@type t() :: %{
  custom: [item()],
  substitute: [item()],
  escape: [item()],
  comment: [item()],
  matrix: [item()],
  flush: [item()],
  magnet: [item()],
  block: [item()],
  shift: [item()],
  pair: [item()],
  disclosure: [item()],
  paragraph: [item()],
  list: [item()],
  tag: [item()],
  brace: [item()]
}

Syntax definition

Link to this section Callbacks

@callback settings() :: settings()

The implementation should return settings for this particular syntax definition

@callback syntax() :: t()

The implementation should return a syntax definition

Link to this section Functions

@spec types() :: [
  :custom
  | :substitute
  | :escape
  | :comment
  | :matrix
  | :flush
  | :magnet
  | :block
  | :shift
  | :pair
  | :disclosure
  | :paragraph
  | :list
  | :tag
  | :brace
]

List of different types of markup