Documentation

Index

Constants

This section is empty.

Variables

View Source
var Booklit = lexers.Register(MustNewLexer(
	&Config{
		Name:      "Booklit",
		Aliases:   []string{"booklit"},
		Filenames: []string{"*.lit"},
		MimeTypes: []string{"text/x-booklit"},
	},
	Rules{
		"root": {
			{`[^\\{}]+`, Text, nil},
			{`\{\{\{`, StringDouble, Push("verbatim")},
			{`\{-`, CommentMultiline, Push("comment")},
			{`[{}]`, NameBuiltin, nil},
			{`\\([a-z-]+)`, Keyword, nil},
			{`\\[\\{}]+`, Text, nil},
		},
		"verbatim": {
			{`\}\}\}`, StringDouble, Pop(1)},
			{`[^}]+`, StringDouble, nil},
			{`}[^\}]`, StringDouble, nil},
		},
		"comment": {
			{`[^-{}]+`, CommentMultiline, nil},
			{`\{-`, CommentMultiline, Push()},
			{`-\}`, CommentMultiline, Pop(1)},
			{`[-{}]`, CommentMultiline, nil},
		},
	},
))

Booklit lexer.

Functions

func NewPlugin

func NewPlugin(section *booklit.Section) booklit.Plugin

Types

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func (Plugin) Syntax

func (plugin Plugin) Syntax(language string, code booklit.Content, styleName ...string) (booklit.Content, error)

Directories

Path Synopsis
plugin