mirror of
https://github.com/daylinmorgan/hwylterm.git
synced 2025-02-22 09:25:49 -06:00
start design file for dumping ideas
This commit is contained in:
parent
f3dbf17846
commit
9a550c1a7f
1 changed files with 30 additions and 0 deletions
30
design.md
Normal file
30
design.md
Normal file
|
@ -0,0 +1,30 @@
|
|||
# design
|
||||
|
||||
A dump for fleshing out in-progress/future design ideas.
|
||||
|
||||
## tables
|
||||
|
||||
a table can like the others build off of bbansi to support some basic ansi rendering.
|
||||
to do this effectively I may need to pull in unicode and unicode_db.
|
||||
|
||||
but the general idea would probably be something like:
|
||||
|
||||
```nim
|
||||
var table = newHwylTable(style = Ansi)
|
||||
table.addColumn(name = "movie")
|
||||
table.addColumn(name = "box office")
|
||||
table.addSep()
|
||||
table.addRow "Avatar", "2,923,706,026"
|
||||
table.addRow "Avengers: Endgame", "2,797,501,328"
|
||||
echo table
|
||||
```
|
||||
resulting in:
|
||||
|
||||
```txt
|
||||
| movie | box office |
|
||||
|-------------------|---------------|
|
||||
| Avatar | 2,923,706,026 |
|
||||
| Avengers: Endgame | 2,797,501,328 |
|
||||
```
|
||||
|
||||
A good table API could be reused by `hwylcli` using a borderless table for flags and commands
|
Loading…
Add table
Reference in a new issue