Migrate to GitLab

This commit is contained in:
Trevor Slocum 2020-01-22 15:28:19 -08:00
parent 51704b9844
commit 5f880bc2c7
60 changed files with 83 additions and 110 deletions

View File

@ -1,14 +0,0 @@
arch: amd64
environment:
PROJECT_NAME: 'cview'
CGO_ENABLED: '1'
GO111MODULE: 'on'
image: freebsd/latest
packages:
- go
sources:
- https://git.sr.ht/~tslocum/cview
tasks:
- test: |
cd $PROJECT_NAME
go test ./...

View File

@ -1,14 +0,0 @@
arch: x86_64
environment:
PROJECT_NAME: 'cview'
CGO_ENABLED: '1'
GO111MODULE: 'on'
image: alpine/edge
packages:
- go
sources:
- https://git.sr.ht/~tslocum/cview
tasks:
- test: |
cd $PROJECT_NAME
go test ./...

8
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,8 @@
stages:
- test
test:
image: golang:latest
stage: test
script:
- go test -v ./...

View File

@ -5,15 +5,11 @@ suggestions and patches.
Please include as much relevant information as possible.
Review project [documentation](https://godoc.org/git.sr.ht/~tslocum/cview)
Review project [documentation](https://godoc.org/gitlab.com/tslocum/cview)
before submitting an issue.
Share issues and suggestions on the [issue tracker](https://todo.sr.ht/~tslocum/cview).
Share issues and suggestions on the [issue tracker](https://gitlab.com/tslocum/cview/issues).
# Patches (pull requests)
Send patches to the [cview-dev](https://lists.sr.ht/~tslocum/cview-dev) mailing
list.
See [git-send-email.io](https://git-send-email.io) for information on sending
patches via email.
Submit patches as [pull requests](https://gitlab.com/tslocum/cview/merge_requests).

View File

@ -1,5 +1,5 @@
This document explains why [tview](https://github.com/rivo/tview) was forked to
create [cview](https://git.sr.ht/~tslocum/cview) and tracks which tview pull
create [cview](https://gitlab.com/tslocum/cview) and tracks which tview pull
requests have been merged into cview.
# Why fork?

View File

@ -1,18 +1,18 @@
# cview
[![GoDoc](https://godoc.org/git.sr.ht/~tslocum/cview?status.svg)](https://godoc.org/git.sr.ht/~tslocum/cview)
[![builds.sr.ht status](https://builds.sr.ht/~tslocum/cview.svg)](https://builds.sr.ht/~tslocum/cview)
[![GoDoc](https://godoc.org/gitlab.com/tslocum/cview?status.svg)](https://godoc.org/gitlab.com/tslocum/cview)
[![CI status](https://gitlab.com/tslocum/cview/badges/master/pipeline.svg)](https://gitlab.com/tslocum/cview/commits/master)
[![Donate](https://img.shields.io/liberapay/receives/rocketnine.space.svg?logo=liberapay)](https://liberapay.com/rocketnine.space)
Terminal-based user interface toolkit
This package is a fork of [tview](https://github.com/rivo/tview).
See [FORK.md](https://man.sr.ht/~tslocum/cview/FORK.md) for more information.
See [FORK.md](https://gitlab.com/tslocum/cview/blob/master/FORK.md) for more information.
## Demo
Try the demo: ```ssh cview.rocketnine.space -p 20000```
[![Recording of presentation demo](https://git.sr.ht/~tslocum/cview/blob/master/cview.gif)](https://git.sr.ht/~tslocum/cview/tree/master/demos/presentation)
[![Recording of presentation demo](https://gitlab.com/tslocum/cview/blob/master/cview.gif)](https://gitlab.com/tslocum/cview/tree/master/demos/presentation)
## Features
@ -29,12 +29,12 @@ Available widgets:
Widgets may be customized and extended to suit any application.
[Mouse support](https://godoc.org/git.sr.ht/~tslocum/cview#hdr-Mouse_Support) is available.
[Mouse support](https://godoc.org/gitlab.com/tslocum/cview#hdr-Mouse_Support) is available.
## Installation
```bash
go get git.sr.ht/~tslocum/cview
go get gitlab.com/tslocum/cview
```
## Hello World
@ -45,7 +45,7 @@ This basic example creates a box titled "Hello, World!" and displays it in your
package main
import (
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
func main() {
@ -63,7 +63,9 @@ the program in the "demos/presentation" subdirectory.
## Documentation
Package documentation is available on [godoc](https://godoc.org/git.sr.ht/~tslocum/cview).
Package documentation is available on [godoc](https://godoc.org/gitlab.com/tslocum/cview).
An [introduction tutorial](https://github.com/rivo/tview) is also available.
## Dependencies
@ -72,10 +74,5 @@ This package is based on [github.com/gdamore/tcell](https://github.com/gdamore/t
## Support
[CONTRIBUTING.md](https://man.sr.ht/~tslocum/cview/CONTRIBUTING.md) describes how to share
[CONTRIBUTING.md](https://gitlab.com/tslocum/cview/blob/master/CONTRIBUTING.md) describes how to share
issues, suggestions and patches (pull requests).
cview has two mailing lists:
- [cview-discuss](https://lists.sr.ht/~tslocum/cview-discuss) for general discussion
- [cview-dev](https://lists.sr.ht/~tslocum/cview-dev) for development discussion

2
box.go
View File

@ -11,7 +11,7 @@ import (
// Note that all classes which subclass from Box will also have access to its
// functions.
//
// See https://git.sr.ht/~tslocum/cview/wiki/Box for an example.
// See https://gitlab.com/tslocum/cview/wiki/Box for an example.
type Box struct {
// The position of the rect.
x, y, width, height int

View File

@ -6,7 +6,7 @@ import (
// Button is labeled box that triggers an action when selected.
//
// See https://git.sr.ht/~tslocum/cview/wiki/Button for an example.
// See https://gitlab.com/tslocum/cview/wiki/Button for an example.
type Button struct {
*Box

View File

@ -7,7 +7,7 @@ import (
// Checkbox implements a simple box for boolean values which can be checked and
// unchecked.
//
// See https://git.sr.ht/~tslocum/cview/wiki/Checkbox for an example.
// See https://gitlab.com/tslocum/cview/wiki/Checkbox for an example.
type Checkbox struct {
*Box

View File

@ -3,7 +3,7 @@ package main
import (
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
func main() {

View File

@ -1,7 +1,7 @@
// Demo code for the Button primitive.
package main
import "git.sr.ht/~tslocum/cview"
import "gitlab.com/tslocum/cview"
func main() {
app := cview.NewApplication()

View File

@ -1,7 +1,7 @@
// Demo code for the Checkbox primitive.
package main
import "git.sr.ht/~tslocum/cview"
import "gitlab.com/tslocum/cview"
func main() {
app := cview.NewApplication()

View File

@ -1,7 +1,7 @@
// Demo code for the DropDown primitive.
package main
import "git.sr.ht/~tslocum/cview"
import "gitlab.com/tslocum/cview"
func main() {
app := cview.NewApplication()

View File

@ -2,7 +2,7 @@
package main
import (
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
func main() {

View File

@ -2,7 +2,7 @@
package main
import (
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
func main() {

View File

@ -3,7 +3,7 @@ package main
import (
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
func main() {

View File

@ -2,7 +2,7 @@
package main
import (
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
func main() {

View File

@ -4,7 +4,7 @@ import (
"strings"
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
// 1,000 most common English words.

View File

@ -8,7 +8,7 @@ import (
"sync"
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
type company struct {

View File

@ -3,7 +3,7 @@ package main
import (
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
func main() {

View File

@ -2,7 +2,7 @@
package main
import (
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
func main() {

View File

@ -2,7 +2,7 @@
package main
import (
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
func main() {

View File

@ -4,7 +4,7 @@ package main
import (
"fmt"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
const pageCount = 5

View File

@ -1,6 +1,6 @@
package main
import "git.sr.ht/~tslocum/cview"
import "gitlab.com/tslocum/cview"
// Center returns a new primitive which shows the provided primitive in its
// center, given the provided primitive's size.

View File

@ -3,7 +3,7 @@ package main
import (
"fmt"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
// The width of the code window.

View File

@ -4,7 +4,7 @@ import (
"strings"
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
const colorsText = `You can use color tags almost everywhere to partially change the color of a string. Simply put a color name or hex string in square brackets to change the following characters' color. H[green]er[white]e i[yellow]s a[darkcyan]n ex[red]amp[white]le. The [black:red]tags [black:green]look [black:yellow]like [::u]this: [blue:yellow:u[] [#00ff00[]`

View File

@ -4,8 +4,8 @@ import (
"fmt"
"strings"
"git.sr.ht/~tslocum/cview"
"github.com/gdamore/tcell"
"gitlab.com/tslocum/cview"
)
const logo = `

View File

@ -4,7 +4,7 @@ import (
"fmt"
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
// End shows the final slide.
@ -12,7 +12,7 @@ func End(nextSlide func()) (title string, content cview.Primitive) {
textView := cview.NewTextView().SetDoneFunc(func(key tcell.Key) {
nextSlide()
})
url := "https://git.sr.ht/~tslocum/cview"
url := "https://gitlab.com/tslocum/cview"
fmt.Fprint(textView, url)
return "End", Center(len(url), 1, textView)
}

View File

@ -2,7 +2,7 @@ package main
import (
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
// Flex demonstrates flexbox layout.

View File

@ -1,13 +1,13 @@
package main
import (
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
const form = `[green]package[white] main
[green]import[white] (
[red]"git.sr.ht/~tslocum/cview"[white]
[red]"gitlab.com/tslocum/cview"[white]
)
[green]func[white] [yellow]main[white]() {

View File

@ -2,7 +2,7 @@ package main
import (
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
// Grid demonstrates the grid layout.

View File

@ -2,13 +2,13 @@ package main
import (
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
const helloWorld = `[green]package[white] main
[green]import[white] (
[red]"git.sr.ht/~tslocum/cview"[white]
[red]"gitlab.com/tslocum/cview"[white]
)
[green]func[white] [yellow]main[white]() {

View File

@ -2,7 +2,7 @@ package main
import (
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
const inputField = `[green]package[white] main
@ -11,7 +11,7 @@ const inputField = `[green]package[white] main
[red]"strconv"[white]
[red]"github.com/gdamore/tcell"[white]
[red]"git.sr.ht/~tslocum/cview"[white]
[red]"gitlab.com/tslocum/cview"[white]
)
[green]func[white] [yellow]main[white]() {

View File

@ -1,6 +1,6 @@
package main
import "git.sr.ht/~tslocum/cview"
import "gitlab.com/tslocum/cview"
// Introduction returns a cview.List with the highlights of the cview package.
func Introduction(nextSlide func()) (title string, content cview.Primitive) {

View File

@ -16,8 +16,8 @@ import (
"fmt"
"strconv"
"git.sr.ht/~tslocum/cview"
"github.com/gdamore/tcell"
"gitlab.com/tslocum/cview"
)
// Slide is a function which returns the slide's main primitive and its title.

View File

@ -3,7 +3,7 @@ package main
import (
"time"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
// ProgressBar demonstrates the ProgressBar.

View File

@ -5,7 +5,7 @@ import (
"strings"
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
const tableData = `OrderDate|Region|Rep|Item|Units|UnitCost|Total

View File

@ -5,8 +5,8 @@ import (
"strconv"
"time"
"git.sr.ht/~tslocum/cview"
"github.com/gdamore/tcell"
"gitlab.com/tslocum/cview"
)
const textView1 = `[green]func[white] [yellow]main[white]() {
@ -65,7 +65,7 @@ const textView2 = `[green]package[white] main
[red]"strconv"[white]
[red]"github.com/gdamore/tcell"[white]
[red]"git.sr.ht/~tslocum/cview"[white]
[red]"gitlab.com/tslocum/cview"[white]
)
[green]func[white] [yellow]main[white]() {

View File

@ -4,12 +4,12 @@ import (
"strings"
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
const treeAllCode = `[green]package[white] main
[green]import[white] [red]"git.sr.ht/~tslocum/cview"[white]
[green]import[white] [red]"gitlab.com/tslocum/cview"[white]
[green]func[white] [yellow]main[white]() {
$$$

View File

@ -5,7 +5,7 @@ import (
"fmt"
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
// RadioButtons implements a simple primitive for radio button selections.

View File

@ -4,7 +4,7 @@ package main
import (
"time"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
func main() {

View File

@ -5,7 +5,7 @@ import (
"strings"
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
func main() {

View File

@ -8,7 +8,7 @@ import (
"time"
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
const corporate = `Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment.

View File

@ -6,7 +6,7 @@ import (
"path/filepath"
"github.com/gdamore/tcell"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
// Show a navigable tree view of the current directory.

View File

@ -4,7 +4,7 @@ package main
import (
"fmt"
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
func main() {

2
doc.go
View File

@ -38,7 +38,7 @@ world!":
package main
import (
"git.sr.ht/~tslocum/cview"
"gitlab.com/tslocum/cview"
)
func main() {

View File

@ -21,7 +21,7 @@ func ExampleNewApplication() {
mainLayout.AddItem(sharedTextView, 1, 0, 1, 1, 0, 0, false)
// Create about layout using Grid.
aboutTextView := NewTextView().SetText("cview muti-layout application example\n\nhttps://git.sr.ht/~tslocum/cview").SetTextAlign(AlignCenter)
aboutTextView := NewTextView().SetText("cview muti-layout application example\n\nhttps://gitlab.com/tslocum/cview").SetTextAlign(AlignCenter)
aboutLayout := NewGrid()
aboutLayout.AddItem(aboutTextView, 0, 0, 1, 1, 0, 0, false)
aboutLayout.AddItem(sharedTextView, 1, 0, 1, 1, 0, 0, false)

View File

@ -15,7 +15,7 @@ type dropDownOption struct {
// DropDown implements a selection widget whose options become visible in a
// drop-down list when activated.
//
// See https://git.sr.ht/~tslocum/cview/wiki/DropDown for an example.
// See https://gitlab.com/tslocum/cview/wiki/DropDown for an example.
type DropDown struct {
*Box

View File

@ -23,7 +23,7 @@ type flexItem struct {
// distributed along that dimension depends on their layout settings, which is
// either a fixed length or a proportional length. See AddItem() for details.
//
// See https://git.sr.ht/~tslocum/cview/wiki/Flex for an example.
// See https://gitlab.com/tslocum/cview/wiki/Flex for an example.
type Flex struct {
*Box

View File

@ -38,7 +38,7 @@ type FormItem interface {
// Checkbox. These elements can be optionally followed by one or more buttons
// for which you can define form-wide actions (e.g. Save, Clear, Cancel).
//
// See https://git.sr.ht/~tslocum/cview/wiki/Form for an example.
// See https://gitlab.com/tslocum/cview/wiki/Form for an example.
type Form struct {
*Box

View File

@ -15,7 +15,7 @@ type frameText struct {
// Frame is a wrapper which adds a border around another primitive. The top area
// (header) and the bottom area (footer) may also contain text.
//
// See https://git.sr.ht/~tslocum/cview/wiki/Frame for an example.
// See https://gitlab.com/tslocum/cview/wiki/Frame for an example.
type Frame struct {
*Box

2
go.mod
View File

@ -1,4 +1,4 @@
module git.sr.ht/~tslocum/cview
module gitlab.com/tslocum/cview
go 1.12

View File

@ -27,7 +27,7 @@ type gridItem struct {
// and "l" keys) while the grid has focus and none of its contained primitives
// do.
//
// See https://git.sr.ht/~tslocum/cview/wiki/Grid for an example.
// See https://gitlab.com/tslocum/cview/wiki/Grid for an example.
type Grid struct {
*Box

View File

@ -29,7 +29,7 @@ import (
// - Ctrl-W: Delete the last word before the cursor.
// - Ctrl-U: Delete the entire line.
//
// See https://git.sr.ht/~tslocum/cview/wiki/InputField for an example.
// See https://gitlab.com/tslocum/cview/wiki/InputField for an example.
type InputField struct {
*Box

View File

@ -17,7 +17,7 @@ type listItem struct {
// List displays rows of items, each of which can be selected.
//
// See https://git.sr.ht/~tslocum/cview/wiki/List for an example.
// See https://gitlab.com/tslocum/cview/wiki/List for an example.
type List struct {
*Box

View File

@ -8,7 +8,7 @@ import (
// for an immediate decision. It needs to have at least one button (added via
// AddButtons()) or it will never disappear.
//
// See https://git.sr.ht/~tslocum/cview/wiki/Modal for an example.
// See https://gitlab.com/tslocum/cview/wiki/Modal for an example.
type Modal struct {
*Box

View File

@ -16,7 +16,7 @@ type page struct {
// root primitive. It allows to easily switch the visibility of the contained
// primitives.
//
// See https://git.sr.ht/~tslocum/cview/wiki/Pages for an example.
// See https://gitlab.com/tslocum/cview/wiki/Pages for an example.
type Pages struct {
*Box

View File

@ -208,7 +208,7 @@ func (c *TableCell) GetLastPosition() (x, y, width int) {
//
// Use SetInputCapture() to override or modify keyboard input.
//
// See https://git.sr.ht/~tslocum/cview/wiki/Table for an example.
// See https://gitlab.com/tslocum/cview/wiki/Table for an example.
type Table struct {
*Box

View File

@ -88,7 +88,7 @@ type textViewIndex struct {
// The ScrollToHighlight() function can be used to jump to the currently
// highlighted region once when the text view is drawn the next time.
//
// See https://git.sr.ht/~tslocum/cview/wiki/TextView for an example.
// See https://gitlab.com/tslocum/cview/wiki/TextView for an example.
type TextView struct {
sync.Mutex
*Box

View File

@ -238,7 +238,7 @@ func (n *TreeNode) SetIndent(indent int) *TreeNode {
// using SetPrefixes() for different levels, for example to display hierarchical
// bullet point lists.
//
// See https://git.sr.ht/~tslocum/cview/wiki/TreeView for an example.
// See https://gitlab.com/tslocum/cview/wiki/TreeView for an example.
type TreeView struct {
*Box