Compare commits

..

3 Commits

Author SHA1 Message Date
TorchedSammy 52a58b14c3
docs: update nature doc to have new correct info 2022-05-08 16:03:44 -04:00
TorchedSammy 15035c02cb
fix(doc): check if modmt exists before trying to get module prop docs 2022-05-08 16:02:24 -04:00
Renzix dd678a4a75
fix: Not loading nature module on some systems (#150) 2022-05-08 16:01:06 -04:00
3 changed files with 15 additions and 14 deletions

View File

@ -1,8 +1,7 @@
A bit after creation, we have the outside nature. Little plants, seeds,
growing to their final phase: a full plant. A lot of Hilbish itself is
written in Go, but there are parts made in Lua, being the `doc` command,
command not executable/found hooks to print a message in the shell,
and other things.
written in Go, but there are parts made in Lua, being most builtins
(`doc`, `cd`, cdr), completions, and other things.
Hilbish's Lua core module is called `nature`. It's handled after everything
on the Go side initializes, which is what that first sentence was from.

View File

@ -58,17 +58,19 @@ commander.register('doc', function(args)
local propstr = ''
local modDesc = ''
local modmt = getmetatable(require(mod))
modDesc = modmt.__doc
if modmt.__docProp then
-- not all modules have docs for properties
props = table.map(modmt.__docProp, function(v, k)
return lunacolors.underline(lunacolors.blue(k)) .. ' > ' .. v
end)
if modmt then
modDesc = modmt.__doc
if modmt.__docProp then
-- not all modules have docs for properties
props = table.map(modmt.__docProp, function(v, k)
return lunacolors.underline(lunacolors.blue(k)) .. ' > ' .. v
end)
end
if #props > 0 then
propstr = '\n# Properties\n' .. table.concat(props, '\n') .. '\n'
end
desc = string.format(modDocFormat, modDesc, propstr)
end
if #props > 0 then
propstr = '\n# Properties\n' .. table.concat(props, '\n') .. '\n'
end
desc = string.format(modDocFormat, modDesc, propstr)
end
print(desc .. formattedFuncs)
f:close()

View File

@ -2,7 +2,7 @@
local _ = require 'succulent' -- Function additions
package.path = package.path .. ';' .. hilbish.dataDir .. '/?/init.lua'
.. ';' .. hilbish.dataDir .. '/?/?.lua'
.. ';' .. hilbish.dataDir .. '/?/?.lua' .. ";" .. hilbish.dataDir .. '/?.lua'
require 'nature.commands'
require 'nature.completions'