Search code examples
luadocumentation-generationluadoc

Error generating documentation for lua


i'm trying to generate documentation for my lua project

i have my lua installation folder and within it i have luafilesystem and lualogging but when i try to generate doc using luadoc-start.bat i get an error saying lfs module not found

i think lfs means luafilesystem

so my question is how to install and configure the dependency for luadoc tool?

i'm using this tool as this post saying How to use LuaDoc with LuaForWindows

i wonder if this is the right way or not ?

and i see installation instruction from manual but it's look ambiguous for me

thanks


Solution

  • From a console, start the Lua interactive interpreter and do require "lfs". If it says "module lfs not found" then your installation is incorrect. Create a Lua script that just prints hello and save it in a folder of your choice, name the file "mytest.Lua". From a Wondows console, CD to that folder and start Lua and require "mytest". If that works, copy the lfs files to the same folder and try require "lfs". If it works, you can now run the luadoc from that folder. If it doesn't, you are missing some lfs files such as a DLL.

    Note: lfs is a Lua module that is provided as a DLL; there is no .lua file for it. When you do require "lfs", Lua will first try the to find any module of given name that matches one of the patterns in package.path (try print(package.path)) then if no matches, it will do same for all patterns in package.cpath. Pay close attention to the error message you get once you type the require lfs command: it should indicate which patterns it tried, in what folders.