about summary refs log tree commit diff stats
path: root/src/teliva.c
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-02-17 20:16:36 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-02-17 20:16:36 -0800
commit9421ea7151fef8dbe95f965a0ab1d3da16914c40 (patch)
treecd4a5ea22d5851236335713701e496eb8b7dd351 /src/teliva.c
parent0e19efeb2ee2e38054284d633690b54e8eb9b8ce (diff)
downloadteliva-9421ea7151fef8dbe95f965a0ab1d3da16914c40.tar.gz
'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.
Diffstat (limited to 'src/teliva.c')
-rw-r--r--src/teliva.c11
1 files changed, 10 insertions, 1 deletions
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")) {