cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2017 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ScanDefaultString string
	ScanAllowEmpty    bool
)
View Source
var Extention string = ".md"

Functions

func EditPage

func EditPage(res *crowi.Pages, line Line) error

func FileContent

func FileContent(fname string) string

func GetDefaultDir

func GetDefaultDir() (string, error)

func NewClient

func NewClient() (*crowi.Client, error)

func OpenURL

func OpenURL(target string) error

func Run

func Run(command string, args ...string) error

func Scan

func Scan(message string, allowEmpty bool) (string, error)

func TempFile

func TempFile(filename string) (*os.File, error)

func Underline

func Underline(message, target string) error

Types

type Config

type Config struct {
	Core  CoreConfig
	Crowi CrowiConfig
}
var Conf Config

func (*Config) LoadFile

func (cfg *Config) LoadFile(file string) error

type CoreConfig

type CoreConfig struct {
	Editor    string `toml:"editor"`
	TomlFile  string `toml:"toml_file"`
	SelectCmd string `toml:"selectcmd"`
}

type CrowiConfig

type CrowiConfig struct {
	Token     string `toml:"token"`
	BaseURL   string `toml:"base_url"`
	User      string `toml:"user"`
	LocalPath string `toml:"local_path"`
	Paging    bool   `toml:"paging"`
}

type Line

type Line struct {
	Path      string
	URL       string
	ID        string
	LocalPath string
}

type Lines

type Lines []Line

type Screen

type Screen struct {
	Text  string
	ID    func(string) string
	Pages *crowi.Pages
}

func NewScreen

func NewScreen() (*Screen, error)

func (*Screen) Select

func (s *Screen) Select() (lines Lines, err error)

Jump to

Keyboard shortcuts

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