From faf7fa59df76235338472175dee1d6b550affa61 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Mon, 25 Feb 2019 23:33:50 -0500 Subject: [PATCH] Created Container API (markdown) --- Container-API.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Container-API.md diff --git a/Container-API.md b/Container-API.md new file mode 100644 index 0000000..185a5d8 --- /dev/null +++ b/Container-API.md @@ -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. \ No newline at end of file