From 9421ea7151fef8dbe95f965a0ab1d3da16914c40 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 17 Feb 2022 20:16:36 -0800 Subject: [PATCH] '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. --- chesstv.tlv | 6 ++++++ counter.tlv | 6 ++++++ gemini.tlv | 11 +++++++++++ hanoi.tlv | 8 ++++++++ life.tlv | 13 +++++++++++++ src/teliva.c | 11 ++++++++++- template.tlv | 6 ++++++ toot-toot.tlv | 6 ++++++ zet.tlv | 13 +++++++++++++ 9 files changed, 79 insertions(+), 1 deletion(-) diff --git a/chesstv.tlv b/chesstv.tlv index d96755e..600db26 100644 --- a/chesstv.tlv +++ b/chesstv.tlv @@ -283,3 +283,9 @@ > -- degenerate event loop just to show errors in sandboxing, etc. > while true do curses.getch(); end >end +- __teliva_timestamp: + >Thu Feb 17 20:00:23 2022 + doc:blurb: + >A demo of Teliva's support for networking: watch the current live chess game from LiChessTV. + > + >Compare with https://lichess.org/tv on a browser. diff --git a/counter.tlv b/counter.tlv index 2fff4f2..3cbe053 100644 --- a/counter.tlv +++ b/counter.tlv @@ -59,3 +59,9 @@ > update(window) > end >end +- __teliva_timestamp: + >Thu Feb 17 20:01:19 2022 + doc:blurb: + >Example app: counter widget + > + >Look at the menu below to see what keyboard shortcuts are available. diff --git a/gemini.tlv b/gemini.tlv index b551a8c..34d1404 100644 --- a/gemini.tlv +++ b/gemini.tlv @@ -508,3 +508,14 @@ > table.insert(state.lines, 'invalid response from server: '..line) > end >end +- __teliva_timestamp: + >Thu Feb 17 20:04:42 2022 + doc:blurb: + >A bare-bones browser for the Gemini protocol + > + >https://gemini.circumlunar.space + > + >A couple of good pages to try it out with: + > $ src/teliva gemini.tlv gemini.circumlunar.space + > $ src/teliva gemini.tlv gemini.conman.org + > $ src/teliva gemini.tlv gemini.susa.net/cgi-bin/links.lua # shows 20 random links from Gemini space diff --git a/hanoi.tlv b/hanoi.tlv index aa1f5ba..a3f2620 100644 --- a/hanoi.tlv +++ b/hanoi.tlv @@ -120,3 +120,11 @@ > local lines, cols = window:getmaxyx() > return cols >end +- __teliva_timestamp: + >Thu Feb 17 20:07:06 2022 + doc:blurb: + >Single-player game: the Towers of Hanoi + > + >Move disks around from one tower A to tower B, under one constraint: a disk can never lie above a smaller disk. + > + >https://en.wikipedia.org/wiki/Tower_of_Hanoi diff --git a/life.tlv b/life.tlv index 245981e..804ae49 100644 --- a/life.tlv +++ b/life.tlv @@ -296,3 +296,16 @@ > step() > end >end +- __teliva_timestamp: + >Thu Feb 17 19:58:19 2022 + doc:blurb: + >Conway's Game of Life + > + >To get around limitations of text mode we use the braille character set to render 8 cells per character. + > + >By default it initializes the space with a random state of cells. You can also start it up with .cells files from https://conwaylife.com/wiki, or with a few special names: + > $ src/teliva life.tlv block + > $ src/teliva life.tlv loaf + > $ src/teliva life.tlv blinker + > $ src/teliva life.tlv glider + > $ src/teliva life.tlv pentomino diff --git a/src/teliva.c b/src/teliva.c index eb79285..d42e982 100644 --- a/src/teliva.c +++ b/src/teliva.c @@ -383,6 +383,7 @@ static int starts_with(const char* s, const char* pre) { static int edit_current_definition(lua_State* L); static void recent_changes_view(lua_State* L); static const char* events_view(); +static int look_up_definition (lua_State* L, const char* name); void default_big_picture_view(lua_State* L) { /* Without any intervening edits, big_picture_view always stably renders * definitions in exactly the same spatial order, both in levels from top to @@ -408,6 +409,15 @@ restart: mvaddstr(y, 0, "Big picture"); attrset(A_NORMAL); y += 2; + + int found = look_up_definition(L, "doc:blurb"); + if (found) { + assert(lua_isstring(L, -1)); + y = render_wrapped_text(y, 8, 68, lua_tostring(L, -1)); + y += 2; + lua_pop(L, 1); + } + mvaddstr(y, 0, "data: "); // first: data (non-functions) that's not the Teliva menu or curses variables if (highlight_level < 0) highlight_level = 0; @@ -647,7 +657,6 @@ restart: } extern int edit(lua_State* L, char* filename, char* definition_name); -static int look_up_definition (lua_State* L, const char* name); void big_picture_view(lua_State* L) { int oldtop = lua_gettop(L); if (!look_up_definition(L, "doc:main")) { diff --git a/template.tlv b/template.tlv index 1e67dc6..b17fd7d 100644 --- a/template.tlv +++ b/template.tlv @@ -199,3 +199,9 @@ > update(window) > end >end +- __teliva_timestamp: + >Thu Feb 17 20:10:02 2022 + doc:blurb: + >To show a brief description of the app on the 'big picture' screen, put the text in a special buffer called 'doc:blurb'. + > + >You can also override the default big picture screen entirely by creating a buffer called 'doc:main'. diff --git a/toot-toot.tlv b/toot-toot.tlv index 4d06ecb..b22ac61 100644 --- a/toot-toot.tlv +++ b/toot-toot.tlv @@ -518,3 +518,9 @@ > check_eq(cursor_up('abcdefg\nhij', 11, 5), 8, 'cursor_up to wrapping line: final char') > check_eq(cursor_up('abcdefg\nhij', 12, 5), 8, 'cursor_up to wrapping line: to shorter line') >end +- __teliva_timestamp: + >Thu Feb 17 19:52:30 2022 + doc:blurb: + >A tiny editor (no scrolling) for composing a series of toots or tweets. Always shows character counts for current state of prose. + > + >Typing '===' on its own lines, surrounded by empty lines, partitions prose and gives all segments independent character counts. Good for threads (tweetstorms). diff --git a/zet.tlv b/zet.tlv index 8df3514..7334592 100644 --- a/zet.tlv +++ b/zet.tlv @@ -6392,3 +6392,16 @@ > -- history of screen render state > history = {}, -- elems {first_zettel=view_settings.first_zettel, cursor=current_zettel_id} >} +- __teliva_timestamp: + >Thu Feb 17 20:15:14 2022 + doc:blurb: + >A rudimentary Zettelkasten app trying to hew very close to the original analog setup, as described by abramdemski: + > + >https://www.lesswrong.com/posts/NfdHG6oHBJ8Qxc26s/the-zettelkasten-method-1 + > + >The key attributes of Zettelkasten seem to be: + >- notes organized in small fragments called 'cards' that can't hold much text + >- a tree-based organization using sibling and child cards, with the ability to insert children and siblings to any card, any time + >- ability to cross-link any card to any other, turning the tree into a graph (but still with a strong sense of hierarchy) + > + >zet.tlv satisfies these properties, but isn't very intuitive or usable yet. Contributions appreciated.