pages

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2019 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Command string
	Args    []string
}

Command is the representation of a tip's command suggestion

func (*Command) Display

func (c *Command) Display() string

Display returns colored and indented text for rendering output

func (*Command) String

func (c *Command) String() string

type Page

type Page struct {
	Name string
	Desc string
	Tips []*Tip
}

Page is the representation of a tldr page itself

func ParsePage

func ParsePage(s string) *Page

Parse page from bare markdown string. Rather than parsing markdown itself initial implementation approach is stripping from a single string

func QueryRandom

func QueryRandom() (p *Page, err error)

func Read

func Read(seq []string) (p *Page, err error)

Read finds and creates the Page, if it does not find, simply returns abstract contribution guide

func ReadAll

func ReadAll() (p *Page, err error)

func (*Page) Display

func (p *Page) Display() string

Display returns colored and indented text for rendering output

func (*Page) String

func (p *Page) String() string

type Tip

type Tip struct {
	Desc string
	Cmd  *Command
}

Tip is the list item of a tldr page

func (*Tip) Display

func (t *Tip) Display() string

Display returns colored and indented text for rendering output

func (*Tip) String

func (t *Tip) String() string

Jump to

Keyboard shortcuts

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