html

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: ISC Imports: 6 Imported by: 0

Documentation

Overview

Package html provides a simple html highlighter for Goal code working at the token level.

See cmd/goal2html/README.md for an example of styling with CSS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Highlighter

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

Highlighter represents an html syntax highlighter for Goal code.

func NewHighlighter

func NewHighlighter(opts Options) *Highlighter

NewHighlighter returns a new Highlighter initialized with the given options.

func (*Highlighter) Execute

func (h *Highlighter) Execute(w io.Writer, source string) error

Execute applies the highlighter with given source, writing the output to w.

type Options

type Options struct {
	Monads    []string // list of custom monadic keywords
	Dyads     []string // list of custom dyadic keywords
	NoShebang bool     // disable shebang scanning
	DisableIO bool     // disable default IO keywords
	Prefix    string   // prefix for HTML class names
}

Options represents the configurable parameters for NewHighlighter.

Jump to

Keyboard shortcuts

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