Commit Graph

26 Commits

Author SHA1 Message Date
Kartik K. Agaram b56590ddc9 some more reorg of the standard library
Now life.tlv and gemini.tlv are also minimizing how much of the standard
library they pull in, just to be easy to read.
2022-03-27 11:42:19 -07:00
Kartik K. Agaram 14446eefc4 helper: count permutations 2022-03-27 11:24:56 -07:00
Kartik K. Agaram dd7da2c62a helper: count 2022-03-27 10:53:41 -07:00
Kartik K. Agaram fddbe08fc8 graphviz: for basic stats, show all nodes ordered
The ordering is topological; nodes come before their dependencies.

Also some more helpful functions in the template for new apps.
2022-03-19 16:59:30 -07:00
Kartik K. Agaram 7859317ece standardize common helpers across all apps
In particular, I merged take_out in anagrams.tlv with all_but in
graphviz.
2022-03-19 00:19:58 -07:00
Kartik K. Agaram aed89b8d35 graphviz: draft notion of nodes in 'focus'
Now the REPL isn't about deciding what to calculate, but just what nodes
to calculate it for.
2022-03-18 21:22:18 -07:00
Kartik K. Agaram 29d53c21ac graphviz: don't interpret substrings as regexes 2022-03-18 10:43:48 -07:00
Kartik K. Agaram 6a3098d0e9 use method syntax where possible
Perhaps this is a bad idea. It feels arbitrary, what methods Lua happens
to include in string and table objects without having to go through the
respective modules.
2022-03-06 16:38:49 -08:00
Kartik K. Agaram a8d0c1a56a reconcile all apps with template.tlv
They may take more or less from it (sieve.tlv in particular takes
nothing since call depth doesn't help at all there), but what they take
is in the right order so that you can compare across apps.
2022-03-06 02:42:34 -08:00
Kartik K. Agaram 68d956e31a distinguish between window global and arg 2022-03-02 22:15:01 -08:00
Kartik K. Agaram ae51b06dab starting to make Teliva apps more testable
Tasteful apps should only perform side-effects through 'window'
arguments rather than the 'curses' module directly. It's ok however to
read constants like curses.A_NORMAL or curses.stdscr().

There are some limitations, unfortunately. Ncurses wasn't designed with
testability in mind. For example, there's no way to curs_set or
assume_default_colors without the 'curses' module. Oh well.
2022-02-27 08:41:30 -08:00
Kartik K. Agaram 9421ea7151 'doc:blurb': a place to briefly describe an app
This is for what the app does, as opposed to 'doc:main', which is also
intended to include commentary about the internal organization of the
app.
2022-02-17 20:16:36 -08:00
Kartik K. Agaram a8fb6d4002 gemini.tlv: consistent menu 2022-02-08 00:28:04 -08:00
Kartik K. Agaram 3f6861b4db gemini: demo of context-sensitive menu
Basic procedure:
  - save/restore `menu` around call of a function (directly or
    indirectly called by `update`) that encapsulates some state change
  - override `menu` inside the function to correspond to its update loop
2022-01-18 20:11:56 -08:00
Kartik K. Agaram 0de63dd710 gemini.tlv: stop using default background 2021-12-25 22:07:34 -08:00
Kartik K. Agaram e9d72de48b gemini: better error-handling 2021-12-25 22:03:19 -08:00
Kartik K. Agaram 434d36f81f a little more reorg
Put stuff people messing with Teliva apps are likely to need above the C
interface.

The state of documentation for Teliva app creators is still quite poor.
All they really have to go on is the example apps.
2021-12-25 13:44:07 -08:00
Kartik K. Agaram 343316dcfa more precise control over menu order
I can't believe I didn't notice this until now.
2021-12-22 00:27:50 -08:00
Kartik K. Agaram c537e7bc2d gemini: back button 2021-12-22 00:07:16 -08:00
Kartik K. Agaram e20f464484 . 2021-12-22 00:06:26 -08:00
Kartik K. Agaram a5ce055762 . 2021-12-22 00:05:08 -08:00
Kartik K. Agaram a9e400bbb4 gemini: links 2021-12-21 23:38:04 -08:00
Kartik K. Agaram f689fb7bed gemini: slightly cleaner rendering of owner input
This still only works if I remove the call to `refresh()` inside
`Wgetch()`. With that call no keystrokes are displayed. Looks like
ncurses doesn't include user input when refreshing the window. Unclear
if there's an easy way to support that while keeping the menu visible.
2021-12-21 16:15:40 -08:00
Kartik K. Agaram 53f235fd26 minor tweaks 2021-12-21 15:06:43 -08:00
Kartik K. Agaram 7eaca58762 gemini: ctrl-g to open a new page 2021-12-21 14:12:17 -08:00
Kartik K. Agaram 5c46538d2d start of a gemini browser 2021-12-20 12:19:05 -08:00