module Cmark

Overview

This module offers high-level parsing and rendering of markdown content, be it Commonmark-only, full GFM, or partially GFM.

If the content is Commonmark-only use the respective commonmark parsing and HTML rendering methods for the best performance. If all of the GFM extensions must be enabled use the gfm methods. For partial support of GFM extensions use the more generic document methods.

Defined in:

cmark.cr
cmark/alignment.cr
cmark/delim_type.cr
cmark/error.cr
cmark/event.cr
cmark/event_iterator.cr
cmark/extension.cr
cmark/fencing_details.cr
cmark/lib_cmark.cr
cmark/list_type.cr
cmark/node.cr
cmark/node_maker.cr
cmark/node_type.cr
cmark/option.cr
cmark/renderer.cr
cmark/renderers/html_renderer.cr
cmark/version.cr

Constant Summary

VERSION = "0.1.3"

Class Method Summary

Class Method Detail

def self.commonmark_to_html(text : String, options = Option::None) : String #

Renders a Commonmark-only text as HTML.


def self.document_to_html(text : String, options = Option::None, extensions = Extension::None) : String #

Renders commonmark text as HTML.


def self.gfm_to_html(text : String, options = Option::None) : String #

Renders commonmark text with all of the GFM extensions enabled as HTML.


def self.parse_commonmark(text : String, options = Option::None) : Node #

Parses a Commonmark-only document text.


def self.parse_document(text : String, options = Option::None, extensions = Extension::None) : Node #

Parses a commonmark document text.


def self.parse_gfm(text : String, options = Option::None) : Node #

Parses a commonmark document text with all of the GFM extensions enabled.