2

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

Community
  • 1
  • 1
Antwan
  • 3,837
  • 9
  • 41
  • 62
  • Please post where you have installed luafilesystem (lfs) and what is your Lua path. – Oliver Jul 12 '14 at 21:16
  • i've installed lua using lua for windows.exe that excutable setup every things for so i have lua installation in C:\Program Files (x86)\lua\5.1 and i installed lfs in the same directory manually and i tried to install it using luarocks but it's doesnt work also i get an error too – Antwan Jul 12 '14 at 22:19
  • my problem is that i'm making corona game and i want to generate docs for my code and i haven't did any thing with lua installation – Antwan Jul 12 '14 at 22:22
  • From a console, start the Lua interactive interpreter and do `require "lfs"`. What happens? – Oliver Jul 12 '14 at 23:02

1 Answers1

0

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.

Oliver
  • 27,510
  • 9
  • 72
  • 103
  • it's works but luafile system not a lua module so how i will require it ? – Antwan Jul 13 '14 at 21:04
  • and lua logging and lfs the dependency for lua doc compatible with lua 5.1 how i can generate docs for lua 5.2? – Antwan Jul 13 '14 at 21:31
  • @tony What makes you say you can't use Lua 5.1 to generate docs for Lua 5.2? – Oliver Jul 14 '14 at 03:44
  • i thought that i must use same version thx @scholli for you r help im gonna try it – Antwan Jul 14 '14 at 08:42
  • so i did as what u said with lua 5.2 and i also installed exe for lua 5.1 it's seems work now in both version but what i get is error atempt to call global module a nil value – Antwan Jul 14 '14 at 12:26
  • with each version i get that error in different file but i both cases the error on the line that contain for ex:module("luadoc") so i got that error here? – Antwan Jul 14 '14 at 12:28
  • @Tony this is a Q&A forum so please try to add facts to your question rather than spread them throughout a slew of comments. You can put a line "*Update 1:*" in your question, with additional info based on what people ask. Then you just put a comment "@whoever see update 1". This way there is one place to look for the all the facts related to a question. – Oliver Jul 14 '14 at 13:10
  • @Tony Btw I don't understand your last comment, please clarify by updating your post as explained. And please pay attention to punctuation, your text is hard to understand, this may decrease how many people bother to answer your question (why would someone answer if you can't be bothered to explain clearly and format properly your question?) – Oliver Jul 14 '14 at 13:11
  • thanks @schollii but i can't update my question because you solution works for me but i get another error i will post another question for that – Antwan Jul 14 '14 at 13:22