Documentation
¶
Overview ¶
Package repotab provides a formatter which show repositories as a table in CLI
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AttributesCell = CellBuildFunc(func(r gogh.Repository) (content string, style aec.ANSI) { contents := []string{""} if r.Private { style = aec.YellowF contents[0] = "private" } else { style = aec.LightBlackF contents[0] = "public" } if r.Fork { contents = append(contents, "fork") } if r.Archived { contents = append(contents, "archived") } return strings.Join(contents, ","), style })
View Source
var DefaultColumns = []Column{{ Priority: 0, CellBuilder: SpecCell, }, { Truncatable: true, MinWidth: 20, Elipsis: "...", Priority: 3, CellBuilder: DescriptionCell, }, { Priority: 1, CellBuilder: AttributesCell, }, { Align: AlignRight, Priority: 2, CellBuilder: UpdatedAtCell, }}
View Source
var DescriptionCell = CellBuildFunc(func(r gogh.Repository) (content string, style aec.ANSI) { content = r.Description return content, aec.DefaultF.With(aec.DefaultB) })
View Source
var EmojiAttributesCell = CellBuildFunc(func(r gogh.Repository) (content string, style aec.ANSI) { contents := []string{""} if r.Private { contents[0] = "\U0001F512\uFE0F " } else { contents[0] = "" } if r.Fork { contents = append(contents, "\U0001F500\uFE0F ") } if r.Archived { contents = append(contents, "\U0001F5C3\uFE0F ") } return strings.Join(contents, ""), aec.EmptyBuilder.ANSI })
View Source
var SpecCell = CellBuildFunc(func(r gogh.Repository) (content string, style aec.ANSI) { content = r.Spec.String() return content, aec.Bold })
View Source
var UpdatedAtCell = CellBuildFunc(func(r gogh.Repository) (content string, style aec.ANSI) { return view.FuzzyAgoAbbr(time.Now(), r.UpdatedAt), aec.LightBlackF })
Functions ¶
This section is empty.
Types ¶
type CellBuildFunc ¶
type CellBuilder ¶
Click to show internal directories.
Click to hide internal directories.