class Luce::Document

Overview

Maintains the context needed to parse a Markdown document

Defined in:

luce/document.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(block_syntaxes : Array(BlockSyntax) | Nil, inline_syntaxes : Array(InlineSyntax) | Nil, extension_set : ExtensionSet | Nil, link_resolver : Resolver | Nil = nil, image_link_resolver : Resolver | Nil = nil, encode_html : Bool = true, with_default_block_syntaxes : Bool = true, with_default_inline_syntaxes : Bool = true) #

Instance Method Detail

def block_syntaxes : Array(BlockSyntax) #

def encode_html : Bool #

DEPRECATED Use #encode_html? instead. Will be removed in version 1.0.


def encode_html? : Bool #

def footnote_labels : Array(String) #

Footnotes label by appearing order.

They are case-sensitive and added by ref syntax.


def footnote_references : Hash(String, Int32) #

Footnote ref count, keys are case-sensitive and added by define syntax.


def has_custom_inline_syntaxes : Bool #

DEPRECATED Use #has_custom_inline_syntaxes? instead. Will be removed in version 1.0


def has_custom_inline_syntaxes? : Bool #

def image_link_resolver : Resolver | Nil #

def inline_syntaxes : Array(InlineSyntax) #

def link_references : Hash(String, Luce::LinkReference) #

def link_resolver : Resolver | Nil #

def parse(text : String) : Array(Node) #

Parses the given text to a series of AST nodes.


def parse_inline(text : String) : Array(Node) #

Parses the given inline Markdown text to a series of AST nodes.


def parse_line_list(lines : Array(Line)) : Array(Node) #

Parses the given lines of Line to a series of AST nodes.


def parse_lines(lines : Array(String)) : Array(Node) #

Parses the given lines of Markdown to a series of AST nodes.


def with_default_block_syntaxes : Bool #

Whether to use default block syntaxes

DEPRECATED Use #with_default_block_syntaxes? instead. Will be removed in version 1.0.


def with_default_block_syntaxes? : Bool #

Whether to use default block syntaxes


def with_default_inline_syntaxes : Bool #

Whether to use default inline syntaxes.

Need to set both #with_default_block_syntaxes? and #encode_html? to false to disable all inline syntaxes including HTML encoding syntaxes.

DEPRECATED Use #with_default_inline_syntaxes? instead. Will be removed in version 1.0


def with_default_inline_syntaxes? : Bool #

Whether to use default inline syntaxes.

Need to set both #with_default_block_syntaxes? and #encode_html? to false to disable all inline syntaxes including HTML encoding syntaxes.