chroma

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2020 License: MIT Imports: 6 Imported by: 1

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL