From 48a06f8022303c4b8d501c581718996b9ddfbe7e Mon Sep 17 00:00:00 2001 From: sammyette Date: Tue, 11 Jul 2023 20:56:24 -0400 Subject: [PATCH] fix: doc command not displaying correct subdocs when using shorthand api doc access --- nature/commands/doc.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nature/commands/doc.lua b/nature/commands/doc.lua index 7dc33ee..15714d8 100644 --- a/nature/commands/doc.lua +++ b/nature/commands/doc.lua @@ -34,18 +34,18 @@ Available sections: ]] .. table.concat(modules, ', ') local funcdocs = nil local subdocName = args[2] if not f then - -- assume subdir - -- dataDir/docs//.md moddocPath = moddocPath .. mod .. '/' if not subdocName then subdocName = '_index' end f = io.open(moddocPath .. subdocName .. '.md', 'rb') + local oldmoddocPath if not f then - f = io.open(moddocPath .. subdocName:match '%w+' .. '/' .. subdocName .. '.md', 'rb') + moddocPath = moddocPath .. subdocName:match '%w+' .. '/' + f = io.open(moddocPath .. subdocName .. '.md', 'rb') end if not f then - moddocPath = moddocPath .. subdocName .. '/' + moddocPath = oldmoddocPath .. subdocName .. '/' subdocName = args[3] or '_index' f = io.open(moddocPath .. subdocName .. '.md', 'rb') end