3 ms·
This would be fairly easy to build in Emacs for almost any language, but I can't see how this is so useful. Furthermore, if working with Org mode source blocks
by gkya 8y ago
This would be fairly easy to build in Emacs for almost any language, but I can't see how this is so useful. Furthermore, if working with Org mode source blocks, it can render structured data as tables upon evaluation. Say you have this block:
#+BEGIN_SRC elisp
(list (list 'col1 'col2) (list 1 2))
#+END_SRC
(I don't use quote syntax to not confuse non-lispers)
Hitting C-c C-c on it produces the following block just below it:
#+RESULTS:
| col1 | col2 |
| 1 | 2 |
With Org source blocks you can have a literate program even using multiple languages and still communicating easily between source code blocks and both generated and static tables. It can easily be intermixed with formatted text and exported to a suite of various formats, including plain text source code (so-called "tangled source").
Edit: just for the sake of it, another example, this one in Python:
#+BEGIN_SRC python
return [[x for x in range(1,5)],
[chr(y) for y in range(ord('a'),ord('e'))]]
#+END_SRC
#+RESULTS:
| 1 | 2 | 3 | 4 |
| a | b | c | d |
- oblio 8y agoI don't get why in this day and age we can't have proper text mode interfaces. Freaking IBM had box drawing characters in freaking 1985, how hard is it to have them in 2018? https://www.ascii-codes.com/ https://www.ascii-codes.com/ See this: ┌─┬┐ │ ││ ├─┼┤ └─┴┘ vs the crappy table.
- rkeene2 8y agoDo you believe this adds some kind of clarity to the data ?
- oblio 8y agoYes. There's a reason no one (except for hardcore geeks) uses ASCII tables.
- rkeene2 8y agoDo you know what that reason is, and can you elucidate me ?
- oblio 8y agoThey don't look nice... Beauty is in the eye of the beholder, true, but the majority of the beholders want a table to actually look like a table. If you give me pen and paper, I'm not going to draw weird half lines around the table, I'm going to draw the table first, line fully drawn everywhere and then add the content.
- gkya 8y agoIt's misaligned on my screen. Still, it would not be too hard to hack that in to Org.
- pjmlp 8y agoEven GDB TUI comes short to what Turbo products with their Turbo Vision based UI were capable of on MS-DOS.
- TeMPOraL 8y ago| Hello | Planet | Earth | |-------+--------+-------| | foo | 4 | 88 | | bar | 265 | 123 | |-------+--------+-------| | sum | 269 | 211 | This org table looks clean enough to me. The disadvantage of using box drawing characters is that they do not always align nicely - depending on the font, renderer, and couple other things. You can't go wrong with basic ASCII and a fixed-width display.
- deleted 8y ago[deleted]
- gowld 8y agoThe point of Org mode is that you can type the table. How do you type ┌─ ? It's easier to use a font that renders "regular" keyboard characters as borders, akin to https://github.com/tonsky/FiraCode https://github.com/tonsky/FiraCode