No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

║ CARD ║

  Header:       "Jason Hutchinson",
  HeaderMargin: 1,
  Items: []card.Item{
    {Label: "Email", Data: ""},
    {Label: "Web", Data: ""},
    {Label: "Twitter", Data: ""},
    {Label: "GitHub", Data: ""},

// Jason Hutchinson
// ----------------
//   Email:
//     Web:
// Twitter:
//  GitHub:

card is a library which will create sections of content aligned by label length, with optional headers and configurable spacing after each header.


type Section struct {
  Header       string
  HeaderMargin int
  ListIndent   int
  Items        []Item

A Section is an optional header and list of Items.


The string to use as the header. A line of hyphens will be generated to be placed below the header to match its length.


The number of blank lines to place after the header. Default 0.


The number of spaces to precede the list of Items when printed. Default 0.


A slice of card.Items. If an Item with a blank Label and Data field are included, a blank line will be inserted in that spot. This is useful for creating gaps in the list while retaining label alignment.


type Item struct {
  Label string
  Data  string

When printed via the parent Section's String method, an Item's Label will be automatically bolded and padded to be aligned according to the colon which is automatically inserted after it.