ldoc
ldoc copied to clipboard
custom_display_name_handler in config.ld is almost useless: string library is not available
Hi,
I am trying to utilize custom_display_name_handler in my config.ld with no success, because string library is not available within config.ld. Attempt to call string.format or string.sub causes ldoc failure:
template failed for foo: [string "config"]:11: attempt to index a nil value (global 'string')
Built-in functions are available (like print or pairs), but string manipulation abilities are limited with string concatenation operator ... This is too restrictive.
Please let standard libraries, namely string and table, be available from within config.ld.
ldoc v1.4.3, lua 5.3.0.
There's a way to use most string functions, and that's to use them as methods, e.g. ('hello %s'):format('dolly') (the standard metatable for strings has __index==string). I agree that table functions could be useful, however.
For string functions the previous comment has a way to use them. For ever more advanced functions the v1.5.0 release includes a way to include (non-sandboxed) way to load modules.