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 hosting.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: RepoRefCell, }, { 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 hosting.Repository) (content string, style aec.ANSI) { content = r.Description return content, aec.DefaultF.With(aec.DefaultB) })
View Source
var EmojiAttributesCell = CellBuildFunc(func(r hosting.Repository) (content string, style aec.ANSI) { var parts []string if r.Private { parts = append(parts, "🔒") } if r.Fork { parts = append(parts, "🔀") } if r.Archived { parts = append(parts, "🗃️") } return strings.Join(parts, " "), aec.EmptyBuilder.ANSI })
View Source
var RepoRefCell = CellBuildFunc(func(r hosting.Repository) (content string, style aec.ANSI) { content = r.Ref.String() return content, aec.Bold })
View Source
var UpdatedAtCell = CellBuildFunc(func(r hosting.Repository) (content string, style aec.ANSI) { return FuzzyAgoAbbr(time.Now(), r.UpdatedAt), aec.LightBlackF })
Functions ¶
Types ¶
type CellBuildFunc ¶
type CellBuildFunc func(r hosting.Repository) (content string, style aec.ANSI)
func (CellBuildFunc) Build ¶
func (f CellBuildFunc) Build(r hosting.Repository) (content string, style aec.ANSI)
type CellBuilder ¶
type CellBuilder interface {
Build(hosting.Repository) (content string, style aec.ANSI)
}
Click to show internal directories.
Click to hide internal directories.