editor

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package editor edits issue text in the user's $EDITOR.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd(path string) *exec.Cmd

Cmd returns an exec.Cmd that opens path in the user's editor.

func Command

func Command() []string

Command returns the user's editor command: $VISUAL, $EDITOR, or the first of nano, vim, and vi that is installed.

func Parse

func Parse(doc string) (title, body string, ok bool)

Parse splits an edited document into title and body. ok is false when the document is empty, meaning the user cancelled.

func ReadAndRemove

func ReadAndRemove(path string) (string, error)

ReadAndRemove reads the edited file and deletes its temp directory.

func Run

func Run(doc string) (string, error)

Run edits doc in the user's editor, attached to the terminal, and returns the result.

func TempFile

func TempFile(doc string) (string, error)

TempFile writes doc to a new markdown file and returns its path.

func Template

func Template(title, body, help string) string

Template renders title and body as an editable document: the first line is the title and everything after the blank line is the body, like a commit message. help is appended as an HTML comment, which is stripped on parse.

Types

This section is empty.

Jump to

Keyboard shortcuts

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