Created Container API (markdown)

Jakub Sobon 2019-02-25 23:33:50 -05:00
parent c71cefaabc
commit faf7fa59df
1 changed files with 19 additions and 0 deletions

19
Container-API.md Normal file

@ -0,0 +1,19 @@
# Container API
[![Doc Status](https://godoc.org/github.com/mum4k/termdash/container?status.png)](https://godoc.org/github.com/mum4k/termdash/container)
The [container](https://github.com/mum4k/termdash/tree/master/container) package is used to establish and mutate the layout of the screen. An instance of the container object is required to start Termdash, see the [[Termdash API|termdash-api]] for details on how the container object is used.
The container splits the raw terminal into smaller portions (containers). The developer decides how the splits are organised. Design of the container object is heavily inspired by the [i3 window manager](https://i3wm.org/).
The terminal layout is organised in a binary tree structure. Each container is a node in this tree. Each node can contain one of the following:
- two sub-containers; OR
- a widget.
Given a container, developers can create sub-containers by **splitting** the container. There are two kinds of splits:
- horizontal split, which creates top and bottom sub-containers.
- vertical split, which creates left and right sub-containers.
This property is recursive, meaning developers can further split the sub-containers using the same rules.