class Mint::VDOMRenderer

Overview

This is a Virtual DOM renderer for markdown using Markd shard.

The AST for the markdown is a tree where each node refers to the parent node, next sibling and previous sibling.

We walk the nodes and create a tree of nodes and then using the JavaScript builder to render them.

Defined in:

utils/markd_vdom_renderer.cr

Constant Summary

HEADINGS = ["h1", "h2", "h3", "h4", "h5", "h6"] of ::String

Class Method Summary

Instance Method Summary

Class Method Detail

def self.render(replacements : Array(Compiler::Compiled), node : Node | String, separator : String, js : Compiler::Js) : Compiler::Compiled #

[View source]
def self.render(*, highlight : Highlight = Highlight::None, replacements : Array(Compiler::Compiled), document : Markd::Node, separator : String, js : Compiler::Js) : Compiler::Compiled #

[View source]
def self.render_html(*, highlight : Highlight = Highlight::None, replacements : Array(String), document : Markd::Node, separator : String) #

[View source]

Instance Method Detail

def render(document : Markd::Node, separator : String, highlight : Highlight) : Node #

[View source]
def replace(item : String, separator : String) : Array(Node | String) #

[View source]
def replace(node : Node, separator : String) : Array(Node | String) #

[View source]
def stack : Array(Node) #

[View source]