Next
This is the most recent post.
Previous
Older Post
I need to write this down because I spend a few hours trying to use LDoc for generating documentation from Corona SDK, Löve, and anywhere I could use LUA.

Let's blindly follow this steps first and read the full story later:
  • First forget your current Lua environment and install Lua For Windows (Yes, believe me).
  • Open a command line anywhere and type: luarocks install ldoc
  • Open same or other command line in the path where you  have your FileName.lua file.
  • Type: ldoc.lua FileName.lua
  • Done! LDoc has created a new folder (doc) and there you find the HTML document.
Let's talk a bit more...
I was assuming that in your FileName.lua file you had some tags in your function comments like these:


From the code above LDoc generates an HTML doc like this:

Then why was so much trouble doing this that finally seems too easy?
The long story:
Well, I have to say I'm a beginner with Lua and when I first read the LDoc installation instructions it says you have to install first Penlight which require LuaFileSystem what would be very easy with LuaRocks package managment system that comes already installed on Lua For Windows....oh god! But wait, I'm just using Corona SDK with ZeroBrane Studio IDE.

Google didn't help too much, many articles read only added more confusion to my system.

Tried to install LuaRocks to the Lua executable path that comes with ZeroBrane and give up right when I had to supposedly add too many path to the windows environment and possible install something to compile C code!!! :-o

Finally I realized of two silly things:

  1. Lua binaries for windows (a few DLLs and EXEs, that I've installed trying something), is not the same that Lua For Windows (A full installer with IDE and LuaRocks included).
  2. LDoc doesn't need to be "integrated" or "linked" to my development environment (In my case Corona SDK )
So that's how I found that quick solution described at the beginning, installing LDoc with Lua for Windows a complete independent thing, since its does it work anywhere calling it from the command line. For some experts this will look silly stuff, but for me and many Windows-clickers like me this post can be useful.

To learn more about using LDoc read the documentation here


Share To:
Denys Almaral

Denys Almaral

Denys is a 3D artist with an old passion for game development

Post a Comment