Skip to content

Commit

Permalink
docs: sphinx documentation table module closes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsanima committed Aug 12, 2021
1 parent 7271791 commit c744291
Showing 1 changed file with 217 additions and 0 deletions.
217 changes: 217 additions & 0 deletions docs/source/module_table.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
# Module `table`

```{eval-rst}
.. automodule:: mdsanima_dev.utils.table
```

## Class `table`

```{eval-rst}
.. autoclass:: mdsanima_dev.utils.table.table
.. automethod:: colors
.. automethod:: connect
```

### Method ``headers()``

```{eval-rst}
.. automethod:: mdsanima_dev.utils.table.table.headers
```

````{tabbed} Terminal Acrylic
```{eval-rst}
.. figure:: _static/screenshot/table_show_01_acrylic_a.jpg
:name: show-table-01-ac-a
```
````

````{tabbed} Terminal Dark
```{eval-rst}
.. figure:: _static/screenshot/table_show_01_dark_a.jpg
:name: show-table-01-dk-a
```
````

````{tabbed} Terminal Acrylic Border
:selected:
```{eval-rst}
.. figure:: _static/screenshot/table_show_01_acrylic_b.jpg
:name: show-table-01-ac-b
```
````

````{tabbed} Terminal Dark Border
```{eval-rst}
.. figure:: _static/screenshot/table_show_01_dark_b.jpg
:name: show-table-01-dk-b
```
````

### Method ``content()``

```{eval-rst}
.. automethod:: mdsanima_dev.utils.table.table.content
```

````{tabbed} Terminal Acrylic
```{eval-rst}
.. figure:: _static/screenshot/table_show_02_acrylic_a.jpg
:name: show-table-02-ac-a
```
````

````{tabbed} Terminal Dark
```{eval-rst}
.. figure:: _static/screenshot/table_show_02_dark_a.jpg
:name: show-table-02-dk-a
```
````

````{tabbed} Terminal Acrylic Border
:selected:
```{eval-rst}
.. figure:: _static/screenshot/table_show_02_acrylic_b.jpg
:name: show-table-02-ac-b
```
````

````{tabbed} Terminal Dark Border
```{eval-rst}
.. figure:: _static/screenshot/table_show_02_dark_b.jpg
:name: show-table-02-dk-b
```
````

## Class `table_elem`

```{eval-rst}
.. autoclass:: mdsanima_dev.utils.table.table_elem
```

### Method ``bot()``

```{eval-rst}
.. automethod:: mdsanima_dev.utils.table.table_elem.bot
```

### Method ``con()``

```{eval-rst}
.. automethod:: mdsanima_dev.utils.table.table_elem.con
```

### Method ``hed()``

```{eval-rst}
.. automethod:: mdsanima_dev.utils.table.table_elem.hed
```

### Method ``mid()``

```{eval-rst}
.. automethod:: mdsanima_dev.utils.table.table_elem.mid
```

### Method ``top()``

```{eval-rst}
.. automethod:: mdsanima_dev.utils.table.table_elem.top
```

## Example usage class ``table_elem``

This is a example function to make a colored table with method of class
``table_elem``. These example show three different tables that are not linked
together.

```python
from mdsanima_dev.utils.table import table_elem
def my_table():
t = table_elem(40)
t.top(64)
t.hed(64, 'I love Python'.center(62), 155)
t.bot(64)
t.top(64)
t.con(64, 'Python', 'hello world', 197, 203)
t.bot(64)
t.top(64)
t.hed(64, 'mdsanima.com'.center(62), 87)
t.bot(64)
```

````{tabbed} Terminal Acrylic
```{eval-rst}
.. figure:: _static/screenshot/table_show_03_acrylic_a.jpg
:name: show-table-03-ac-a
```
````

````{tabbed} Terminal Dark
```{eval-rst}
.. figure:: _static/screenshot/table_show_03_dark_a.jpg
:name: show-table-03-dk-a
```
````

````{tabbed} Terminal Acrylic Border
:selected:
```{eval-rst}
.. figure:: _static/screenshot/table_show_03_acrylic_b.jpg
:name: show-table-03-ac-b
```
````

````{tabbed} Terminal Dark Border
```{eval-rst}
.. figure:: _static/screenshot/table_show_03_dark_b.jpg
:name: show-table-03-dk-b
```
````

This example shows how to create linked tables.

```python
from mdsanima_dev.utils.table import table_elem
def my_table():
t = table_elem(40)
t.top(64)
t.hed(64, 'I love Python'.center(63), 155)
t.mid(64)
t.con(64, 'mdsanima.com'.rjust(28), 'hello world', 197, 203)
t.con(64, 'development'.rjust(28), 'in progress', 87, 86)
t.con(64, 'documentation'.rjust(28), 'sphinx', 31, 61)
t.mid(64)
t.hed(64, 'https://github.com/mdsanima-dev/mdsanima-dev'.center(63), 33)
t.bot(64)
```

````{tabbed} Terminal Acrylic
```{eval-rst}
.. figure:: _static/screenshot/table_show_04_acrylic_a.jpg
:name: show-table-04-ac-a
```
````

````{tabbed} Terminal Dark
```{eval-rst}
.. figure:: _static/screenshot/table_show_04_dark_a.jpg
:name: show-table-04-dk-a
```
````

````{tabbed} Terminal Acrylic Border
:selected:
```{eval-rst}
.. figure:: _static/screenshot/table_show_04_acrylic_b.jpg
:name: show-table-04-ac-b
```
````

````{tabbed} Terminal Dark Border
```{eval-rst}
.. figure:: _static/screenshot/table_show_04_dark_b.jpg
:name: show-table-04-dk-b
```
````

0 comments on commit c744291

Please sign in to comment.