From dfd66512d7d8caf5d75bfaec167cb81b9bd0b26f Mon Sep 17 00:00:00 2001 From: jussi Date: Tue, 31 Oct 2023 22:05:09 +0200 Subject: Global variable descriptions for API. --- docgen.lua | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'docgen.lua') diff --git a/docgen.lua b/docgen.lua index 16c0005..8e4a6e0 100644 --- a/docgen.lua +++ b/docgen.lua @@ -271,8 +271,18 @@ repeat else -- Remove comma from the end. local globalName = lineSplit[2]:sub( 1, -2 ) - local value = RL[ globalName ] + local comment = lineSplit[6] -- First split after // + + if comment ~= nil then + local i = 7 + + while lineSplit[i] ~= nil do + comment = comment.." "..lineSplit[i] + i = i + 1 + end + luaApiFile:write( "---"..comment.."\n" ) + end globalVariableCount = globalVariableCount + 1 @@ -288,9 +298,15 @@ repeat ..math.tointeger( value[1] )..","..math.tointeger( value[2] ).."," ..math.tointeger( value[3] )..","..math.tointeger( value[4] ).."}\n" ) else - apiFile:write( globalName.." = "..value.."\n\n" ) + apiFile:write( "> "..globalName.." = "..value.."\n\n" ) luaApiFile:write( "RL."..globalName.."="..value.."\n" ) end + + if comment ~= nil then + apiFile:write( comment.."\n\n" ) + end + + apiFile:write( "---\n\n" ) end end -- cgit v1.2.3