hr

package module
v0.0.0-...-4cc3df2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: MIT Imports: 4 Imported by: 1

README

hr

MIT License Go Report Card PRs Welcome

generate horizontal rule (hr) for terminals

Install

go get github.com/jakewarren/hr/...

Usage

As a CLI

screenshot

As a library
package main

import (
	"fmt"

	"github.com/jakewarren/hr"
)

func main() {
	fmt.Println(hr.HorizontalRule("-"))
}

Acknowledgements

Heavily based on sashka/hr.
Format specification adapted from LuRsT/hr.

License

MIT © 2019 Jake Warren

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HorizontalRule

func HorizontalRule(line ...string) string

HorizontalRule produces a string with a length matched to the terminal dimensions

func TerminalDimensions

func TerminalDimensions() (columns, rows int, err error)

TerminalDimensions returns the dimensions of the given terminal.

Types

type InfiniteRuneReader

type InfiniteRuneReader struct {
	// contains filtered or unexported fields
}

InfiniteRuneReader produces a rune from a string for infinity

func NewInfiniteRuneReader

func NewInfiniteRuneReader(s string) *InfiniteRuneReader

NewInfiniteRuneReader creates a new InfiniteRuneReader object

func (*InfiniteRuneReader) ReadRune

func (r *InfiniteRuneReader) ReadRune() (ch rune, size int, err error)

ReadRune reads the next rune from the InfiniteRuneReader

Directories

Path Synopsis
cmd
hr

Jump to

Keyboard shortcuts

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