prism

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

README

logo

Prism

GitHub GitHub go.mod Go version GitHub release (latest by date) Go Report Card Go Reference

Create beautiful images of your source code directly from your terminal.

example

Installation

Precompiled prism binaries can be found at releases page.

Instructions below show how to build prism from sources.

go install github.com/mrmarble/prism/cmd/prism@latest # or target a specific version @v0.1.0

Usage

Be sure prism executable is under your $PATH.

Usage of prism: prism [input file] [args...] Run prism without arguments to get help output.

Flags:
  -h, --help                  Show context-sensitive help.
  -l, --lang=STRING           Language to parse.
  -o, --output="prism.png"    output image
      --version               Print version information and quit
  -n, --numbers               display line numbers
      --header                display header

Supported languages

See languages for a list of implemented languages.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

func NewContext

func NewContext() *Context

func (*Context) EncodePNG

func (ctx *Context) EncodePNG(code string, writer io.Writer, options Options) error

func (*Context) SavePNG

func (ctx *Context) SavePNG(code string, output string, options Options) error

func (*Context) SetFontFace

func (ctx *Context) SetFontFace(path string, points float64) error

func (*Context) SetLanguage

func (ctx *Context) SetLanguage(lang tokenizer.Language)

func (*Context) SetTheme

func (ctx *Context) SetTheme(theme themer.Theme)

type Options

type Options struct {
	LineNumbers bool
	Header      bool
}

Directories

Path Synopsis
cmd
prism command

Jump to

Keyboard shortcuts

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