syntax

package
v0.0.0-...-0690ca1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package syntax generates syntax highlighting for preformatted code blocks using the "chroma" processor. All of the themes and styles from the processor are directly exposed through the plugin interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Placement

type Placement int
const (
	PlaceInside Placement = iota
	PlaceInline
)

type Syntax

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

Syntax chainable context.

func New

func New() *Syntax

New creates a new instance of the Syntax plugin.

func (*Syntax) Initialize

func (*Syntax) Initialize(context *goldsmith.Context) error

func (*Syntax) LineNumbers

func (self *Syntax) LineNumbers(numbers bool) *Syntax

LineNumbers sets the visibility of a line number gutter next to the code (default: false).

func (*Syntax) Name

func (*Syntax) Name() string

func (*Syntax) Placement

func (self *Syntax) Placement(placement Placement) *Syntax

Placement determines if code should replace the containing block or be placed inside of it (default: "PlaceInside").

func (*Syntax) Prefix

func (self *Syntax) Prefix(prefix string) *Syntax

Prefix sets the CSS class name prefix for code language identification (default: "language-").

func (*Syntax) Process

func (self *Syntax) Process(context *goldsmith.Context, inputFile *goldsmith.File) error

func (*Syntax) Style

func (self *Syntax) Style(style string) *Syntax

Style sets the color scheme used for syntax highlighting (default: "github"). Additional styles can be found at: https://github.com/alecthomas/chroma/tree/master/styles.

Jump to

Keyboard shortcuts

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