From a2f0ff3e091aae80bd3008af9dd77a06616780c1 Mon Sep 17 00:00:00 2001 From: TorchedSammy Date: Sat, 7 Jan 2023 15:52:49 +0000 Subject: [PATCH 1/4] docs: [ci] generate new docs --- docs/api/hilbish/hilbish.aliases.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/api/hilbish/hilbish.aliases.md b/docs/api/hilbish/hilbish.aliases.md index 9b90e5c..34182ad 100644 --- a/docs/api/hilbish/hilbish.aliases.md +++ b/docs/api/hilbish/hilbish.aliases.md @@ -17,9 +17,8 @@ This is an alias (ha) for the `hilbish.alias` function. ### delete(name) Removes an alias. -### list() -> aliases (table) +### list() -> table Get a table of all aliases, with string keys as the alias and the value as the command. -@returns table ### resolve(alias) -> command (string) Tries to resolve an alias to its command. From 354f257c0385153663be19c6f867d9335479a86b Mon Sep 17 00:00:00 2001 From: sammyette Date: Sat, 7 Jan 2023 13:54:08 -0400 Subject: [PATCH 2/4] feat(commands/doc): make it easier to get interface docs --- nature/commands/doc.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nature/commands/doc.lua b/nature/commands/doc.lua index bc45eea..f8eec18 100644 --- a/nature/commands/doc.lua +++ b/nature/commands/doc.lua @@ -24,6 +24,9 @@ commander.register('doc', function(args) subdocName = '_index' end f = io.open(moddocPath .. subdocName .. '.md', 'rb') + if not f then + f = io.open(moddocPath .. subdocName:match '%w+' .. '/' .. subdocName .. '.md', 'rb') + end if not f then moddocPath = moddocPath .. subdocName .. '/' subdocName = args[3] or '_index' From 4e023703b6bc6955c4de4805f673482bb85166d0 Mon Sep 17 00:00:00 2001 From: sammyette Date: Sat, 7 Jan 2023 14:01:57 -0400 Subject: [PATCH 3/4] feat(commands/doc): use local docs directory if hilbish branch is found --- nature/commands/doc.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nature/commands/doc.lua b/nature/commands/doc.lua index f8eec18..295e042 100644 --- a/nature/commands/doc.lua +++ b/nature/commands/doc.lua @@ -4,6 +4,11 @@ local lunacolors = require 'lunacolors' commander.register('doc', function(args) local moddocPath = hilbish.dataDir .. '/docs/' + local stat = fs.stat '.git/refs/heads/extended-job-api' + if stat then + -- hilbish git + moddocPath = './docs/' + end local apidocHeader = [[ # %s {grayBg} {white}{italic}%s {reset} From a6bcfdfca92e1958e77f7bd1880faeaf1336754b Mon Sep 17 00:00:00 2001 From: sammyette Date: Sat, 7 Jan 2023 14:02:21 -0400 Subject: [PATCH 4/4] feat(commands/doc): return 1 exit code when doc not found --- nature/commands/doc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nature/commands/doc.lua b/nature/commands/doc.lua index 295e042..6f39306 100644 --- a/nature/commands/doc.lua +++ b/nature/commands/doc.lua @@ -39,7 +39,7 @@ commander.register('doc', function(args) end if not f then print('No documentation found for ' .. mod .. '.') - return + return 1 end end funcdocs = f:read '*a':gsub('-([%d]+)', '%1')