editor

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package editor contains functionality which allows the user to provide information in the editor of their choice.

Index

Constants

View Source
const (
	UnixDefaultEditor       = "vi"
	WindowsDefaultEditor    = "notepad"
	EnvironmentVariableName = "EDITOR"
	InteractiveModeLabel    = "interactive mode"
)

Variables

This section is empty.

Functions

func CaptureInputFromEditor

func CaptureInputFromEditor(template []byte) ([]byte, error)

CaptureInputFromEditor opens a temporary file in a text editor and returns the written bytes on success or an error on failure. It handles deletion of the temporary file behind the scenes.

func EscapeHTML added in v1.0.0

func EscapeHTML(s interface{}) (template.HTML, error)

EscapeHTML is a function which marshal `s` applying Intent and returns template.HTML. This makes hmtl.Template to escape HTML codes

func IsLastElementOfSlice

func IsLastElementOfSlice(index int, lenght int) bool

isLastElementOfSlice is a function which is used in HTML templates to determine the last element in a slice

func OpenFileInEditor

func OpenFileInEditor(filename string) error

OpenFileInEditor opens filename in a text editor.

func OpenInteractiveEditor

func OpenInteractiveEditor(o interface{}, temp string, funcMap template.FuncMap) ([]byte, error)

OpenInteractiveEditor opens users default editor populated with a JSON representation of a structure

Types

This section is empty.

Jump to

Keyboard shortcuts

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