sheet

package
v0.0.0-...-7908a67 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package sheet implements functions pertaining to parsing, searching, and displaying cheatsheets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sheet

type Sheet struct {
	Title     string
	CheatPath string
	Path      string
	Text      string
	Tags      []string
	Syntax    string
	ReadOnly  bool
}

Sheet encapsulates sheet information

func New

func New(
	title string,
	cheatpath string,
	path string,
	tags []string,
	readOnly bool,
) (Sheet, error)

New initializes a new Sheet

func (*Sheet) Colorize

func (s *Sheet) Colorize(conf config.Config)

Colorize applies syntax-highlighting to a cheatsheet's Text.

func (*Sheet) Copy

func (s *Sheet) Copy(dest string) error

Copy copies a cheatsheet to a new location

func (*Sheet) Search

func (s *Sheet) Search(reg *regexp.Regexp) string

Search returns lines within a sheet's Text that match the search regex

func (*Sheet) Tagged

func (s *Sheet) Tagged(needle string) bool

Tagged returns true if a sheet was tagged with `needle`

Jump to

Keyboard shortcuts

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