Module: Commonmarker::Config

Extended by:
Utils
Defined in:
lib/commonmarker/config.rb

Constant Summary collapse

OPTIONS =
{
  parse: {
    smart: false,
    default_info_string: "",
    relaxed_tasklist_matching: false,
    relaxed_autolinks: false,
  }.freeze,
  render: {
    hardbreaks: true,
    github_pre_lang: true,
    full_info_string: false,
    width: 80,
    unsafe: false,
    escape: false,
    sourcepos: false,
    escaped_char_spans: true,
    ignore_setext: false,
    ignore_empty_links: false,
    gfm_quirks: false,
    prefer_fenced: false,
  }.freeze,
  extension: {
    strikethrough: true,
    tagfilter: true,
    table: true,
    autolink: true,
    tasklist: true,
    superscript: false,
    header_ids: "",
    footnotes: false,
    description_lists: false,
    front_matter_delimiter: "",
    multiline_block_quotes: false,
    math_dollars: false,
    math_code: false,
    shortcodes: true,
    wikilinks_title_before_pipe: false,
    wikilinks_title_after_pipe: false,
    underline: false,
    spoiler: false,
    greentext: false,
    subscript: false,
  }.freeze,
  format: [:html].freeze,
}.freeze
PLUGINS =
{
  syntax_highlighter: {
    theme: "base16-ocean.dark",
    path: "",
  },
}

Constants included from Constants

Commonmarker::Constants::BOOLS

Class Method Summary collapse

Methods included from Utils

fetch_kv

Class Method Details

.process_options(options) ⇒ Object



63
64
65
66
67
68
69
# File 'lib/commonmarker/config.rb', line 63

def process_options(options)
  {
    parse: process_parse_options(options[:parse].dup),
    render: process_render_options(options[:render].dup),
    extension: process_extension_options(options[:extension].dup),
  }
end

.process_plugins(plugins) ⇒ Object



71
72
73
74
75
# File 'lib/commonmarker/config.rb', line 71

def process_plugins(plugins)
  {
    syntax_highlighter: process_syntax_highlighter_plugin(plugins&.fetch(:syntax_highlighter, nil)),
  }
end