goldsmith-components: Index | Files

package syntax

import ""

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.


Package Files


type Placement Uses

type Placement int
const (
    PlaceInside Placement = iota

type Syntax Uses

type Syntax struct {
    // contains filtered or unexported fields

Syntax chainable context.

func New Uses

func New() *Syntax

New creates a new instance of the Syntax plugin.

func (*Syntax) Initialize Uses

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

func (*Syntax) LineNumbers Uses

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

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

func (*Syntax) Name Uses

func (*Syntax) Name() string

func (*Syntax) Placement Uses

func (plugin *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 Uses

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

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

func (*Syntax) Process Uses

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

func (*Syntax) Style Uses

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

Style sets the color scheme used for syntax highlighting (default: "github"). Additional styles can be found at:

Package syntax imports 8 packages (graph). Updated 2019-04-08. Refresh now. Tools for package owners.