Add introduction to the new online help system

This adds a very basic explanation of the new help command that can be
displayed using ":help intro". This introduction is also added as
default page so that users can simply type ":help" instead.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2013-07-17 01:03:05 +02:00
parent 2c25d99ad0
commit 08f5064ef7
3 changed files with 19 additions and 0 deletions

View File

@ -29,6 +29,7 @@ dist_doc_DATA = \
general.txt \ general.txt \
goto.txt \ goto.txt \
import.txt \ import.txt \
intro.txt \
main.txt \ main.txt \
manual.txt \ manual.txt \
other.txt \ other.txt \

15
doc/intro.txt Normal file
View File

@ -0,0 +1,15 @@
calcurse Online Help
====================
Welcome to the calcurse online help. The online help system allows for easily
getting help on specific calcurse features.
On the calcurse main screen, type `:help <feature>` (e.g. `:help add`) to get
help on a specific feature. Type `:help` without any parameter to display this
introduction or simply use the corresponding keyboard shortcut (`?` by
default).
All help texts are displayed using an external pager. You need to exit the
pager in order to get back to calcurse (pressing `q` should almost always
work). The default pager can be changed by setting the PAGER environment
variable.

View File

@ -503,6 +503,9 @@ static inline void key_generic_cmd(void)
char *topic = strtok(NULL, " "); char *topic = strtok(NULL, " ");
char path[BUFSIZ]; char path[BUFSIZ];
if (!topic)
topic = "intro";
snprintf(path, BUFSIZ, DOCDIR "/%s.txt", topic); snprintf(path, BUFSIZ, DOCDIR "/%s.txt", topic);
if (io_file_exist(path)) { if (io_file_exist(path)) {
wins_launch_external(path, conf.pager); wins_launch_external(path, conf.pager);