Skip to content

Matt3o12/termui-widgets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Termui Widgets Build Status Doc Status

Termui provides additional widgets for termui that only fulfill one purpose. These widgets are not meant to be generic or multifunction. Configuration of these widgets is also very easy.

Hacker News Widget

Hacker New Widget Preview

The Hacker News widget pulls the most recent or top stories from the official Hacker News API. It does that asynchronously and updates its view.
Implementing it is pretty straightforward:

	topStories := hackernews.NewWidget(hackernews.TopStories)
	topStories.Height = 15
	topStories.Width = 100
	draw := func() {
		ui.Render(topStories)
	}

	topStories.UpdateEntries(draw)

You will have to provide a callback which re-renders all Bufferers. Make sure the callback function is side-effect free because it gets called very often.
You may choose to load the most recent stories by calling hackernews.NewWidget(hackernews.MostRecent).

About

Additional widgets for termui.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published