class Luce::ExtensionSet

Overview

ExtensionSets provide a simple grouping mechanism for common Markdown flavours.

For example, the GITHUB_FLAVOURED set of syntax extensions will output HTML in a similar fashion to GitHub's parsing.

Defined in:

luce/extension_set.cr

Constant Summary

COMMON_MARK = ExtensionSet.new([FencedCodeBlockSyntax.new] of BlockSyntax, [InlineHTMLSyntax.new] of InlineSyntax)

The CommonMark extension set is close to compliance with CommonMark.

GITHUB_FLAVOURED = ExtensionSet.new([FencedCodeBlockSyntax.new, TableSyntax.new], [InlineHTMLSyntax.new, StrikethroughSyntax.new, AutolinkExtensionSyntax.new])

The ExtensionSet::GITHUB_FLAVOURED extension set is close to compliance with the Github flavoured Markdown spec.

GITHUB_WEB = ExtensionSet.new([FencedCodeBlockSyntax.new, HeaderWithIdSyntax.new, SetextHeaderWithIdSyntax.new, TableSyntax.new], [InlineHTMLSyntax.new, StrikethroughSyntax.new, EmojiSyntax.new, AutolinkExtensionSyntax.new])

The ExtensionSet::GITHUB_WEB extension set renders Markdown similarly to GitHub.

This is different from the ExtensionSet::GITHUB_FLAVOURED extension set in that GitHub actually renders HTML different from straight GitHub Flavoured Markdown.

(The only difference currently is that GITHUB_WEB renders headers with linkable IDs.)

NONE = ExtensionSet.new([] of BlockSyntax, [] of InlineSyntax)

The ExtensionSet::NONE extension set renders Markdown similar to Markdown.pl.

However, this set does not render exactly the same as Markdown.pl; rather it is more-or-less the CommonMark standard of Markdown, without fenced code blocks, or inline HTML.

Constructors

Instance Method Summary

Constructor Detail

def self.new(block_syntaxes : Array(BlockSyntax), inline_syntaxes : Array(InlineSyntax)) #

Instance Method Detail

def block_syntaxes : Array(BlockSyntax) #

def inline_syntaxes : Array(InlineSyntax) #