[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Help function for lua
- From: bil til <flyer31@...>
- Date: Fri, 17 Jan 2020 01:48:05 -0700 (MST)
I think such a (max) 1 page info summary for each command, has the following
advantages:
- it also works on system which (temperorarily or always) are disconnected
from Internet
- it works everywhere in the world (e. g. in China it is often difficult (or
extremely slow) to connect to English web pages - this works in Shanghai,
but not at remote places)
- you get the info in some very precise and self-contained way (if you link
to a book, then a "sparse lua user" never would be perfectly sure, whether
maybe more info in the book needs to be read ... this is a bit as if you do
a sales contract / bank contract / insurance contract, and then you have
these links to some law texts in the small printed text...).
For me it does not matter, if you do this by some module, or some other way.
But it should be done thus, that it is easy for any lib producer to
implement it directly in the lib c code at the end, as e. g. this "function
table", e. g. some further "help table". If somebody wants to place the help
info in some other file, this might be nice if it is possible, but for
simple libs it definitely should be possible to place it in the same C file
as the lib C code.
Further it would be very nice to design the interface to C such, that it is
also possible to create help info in different languages, if the programmer
wants this. English of course should be default, but if a lib producer wants
to add some further help code for the lib functions in furhter languages,
this then should work.
So it would nice, if you could write in Lua:
help(lib.func) -> english info page will popup if available
help(lib.func, "cn") -> Chinese info page will popup if available
help(lib.func, { "cn", "tw", "e" } -> help command will prefer Chinese info
page, if not available it will show Taiwanese, otherwise it will look for
English
--
Sent from: http://lua.2524044.n2.nabble.com/Lua-l-f2524044.html