Md.Parser.Syntax behaviour (md v0.10.7)

View Source

The behaviour for the custom syntax suppliers

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

Types

item()

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

Syntax item definition

settings()

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

Settings for the parser

t()

@type t() :: %{
  custom: [item()],
  attributes: [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

Callbacks

settings()

@callback settings() :: settings()

The implementation should return settings for this particular syntax definition

syntax()

@callback syntax() :: t()

The implementation should return a syntax definition

Functions

merge(custom, default \\ Map.put(Default.syntax(), :settings, Default.settings()))