previewer

package
v0.0.0-...-165d932 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExtJSMap = map[string]template.HTML{
	".go":     "golang",
	".php":    "php",
	".py":     "python",
	".json":   "json",
	".md":     "markdown",
	".sql":    "sql",
	".js":     "javascript",
	".css":    "css",
	".less":   "less",
	".sass":   "sass",
	".cpp":    "c_cpp",
	".rb":     "ruby",
	".ini":    "ini",
	".yaml":   "yaml",
	".yml":    "yaml",
	".xml":    "xml",
	".coffee": "coffee",
	".sh":     "sh",
}

Functions

func IsCode

func IsCode(ext string) bool

func Preview

func Preview(path string) (template.HTML, error)

Types

type Code

type Code struct {
	Ext string
}

func NewCode

func NewCode(ext string) *Code

func (*Code) Preview

func (i *Code) Preview(content []byte) template.HTML

type Image

type Image struct{}

func (*Image) Preview

func (i *Image) Preview(content []byte) template.HTML

type PDF

type PDF struct{}

func (*PDF) Preview

func (p *PDF) Preview(content []byte) template.HTML

TODO

type Previewer

type Previewer interface {
	Preview(content []byte) template.HTML
}

Jump to

Keyboard shortcuts

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