cli

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2019 License: MIT Imports: 20 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

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

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) (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  `toml:"core"`
	Crowi CrowiConfig `toml:"crowi"`
}
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"`
	PageName  string `toml:"page_name"`
}

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