【问题标题】:How to use luadoc in ubuntu/linux?如何在 ubuntu/linux 中使用 luadoc?
【发布时间】:2013-07-05 14:44:51
【问题描述】:

如题,如何在ubuntu/linux中使用luadoc?我使用批处理文件在 Windows 中生成了文档,但在 ubuntu 中没有成功。有什么想法吗?

luadoc
Usage: /usr/bin/luadoc [options|files]
Generate documentation from files. Available options are:
  -d path                      output directory path
  -t path                      template directory path
  -h, --help                   print this help and exit
      --noindexpage            do not generate global index page
      --nofiles                do not generate documentation for files
      --nomodules              do not generate documentation for modules
      --doclet doclet_module   doclet module to generate output
      --taglet taglet_module   taglet module to parse input code
  -q, --quiet                  suppress all normal output
  -v, --version                print version information

【问题讨论】:

  • 你试过/usr/bin/luadoc [options|files]吗?出了什么问题?
  • 这似乎与编程无关,可能更适合askubuntu.com 或superuser.com
  • 嗨,我试过但得到错误:lua5.1: ./luadoc/doclet/html.lua:224: could not open `index.html' for writing stack traceback: [C]: in函数“断言”./luadoc/doclet/html.lua:224:在函数“开始”/usr/share/lua/5.1/luadoc/init.lua:49:在函数中/share/lua/5.1/ luadoc/init.lua:26>(尾调用):? /usr/bin/luadoc:121: 在主块 [C]: ?
  • 是的,Megtz,你也许是对的......但如果你/在 linux 平台上设法生成 lua 文档的人能详细解释一下参数指的是什么,那就太好了?
  • 和使用的命令导致了这个错误?

标签: lua documentation-generation luadoc


【解决方案1】:

首先,我对 Luadoc 几乎没有经验,但对 Ubuntu 和 Lua 有很多经验,所以我的所有观点都基于我刚刚完成的 luadoc 知识和快速安装。据我所知,Luadoc 是一个 Lua 库(因此也可以在 Lua 脚本和 bash 中使用)。要制作文档(在 bash 中),您只需运行

luadoc file.lua

(其中 file 是您要为其创建文档的文件的名称)

选项 -d 和 -t 用于选择您要放置文件的位置以及要使用的模板(我对此一无所知,恐怕:P)。例如(对于 -d):

luadoc file.lua -d ~/Docs

据我所知,关于实际选项几乎没有其他解释(因为您的代码 sn-p 解释了它们做得足够好)。

现在,看看你在运行时遇到的错误(lua5.1: ... could not open "index.html" for writing),我建议一些事情。一,如果您编译了源代码,那么您可能在某个地方犯了错误,例如没有安装依赖项(我会对此感到惊讶,因为否则您根本无法做到)。如果你这样做了,你可以尝试从 repos 中获取它

sudo apt-get install luadoc

这也将安装依赖项。这可能是问题所在,因为我的 luadoc 工作副本使用命令从 /usr/bin 运行良好

./luadoc

这意味着您的 luadoc 很奇怪,或者您正在做一些有趣的事情(我无法从您所说的内容中解决)。我想你已经安装了 lua5.1(考虑到错误),所以这与它无关。

我给你的建议是尝试跑步

luadoc file.lua

在 file.lua 的目录中使用任何旧的 lua 文件(尽管最好是其中至少有少量数据的文件),并查看它是否在同一文件夹中生成 index.html(不要使用 -d 更改目录,用于测试目的)。如果这不起作用,则使用 apt-get 从存储库重新安装它。如果这样做并尝试 luadoc file.lua 不起作用,则回复错误,因为更大的问题(可能)。

【讨论】:

  • @displayname 我不使用 Windows,所以我不知道。然而,this post 上面有一些东西,虽然它是用 Lua For Windows 而不是 LuaRocks 安装的,所以我不知道这是否有帮助。它可能不在系统路径或其他东西上,在这种情况下,您必须以某种方式添加它(再次强调,我不是 Windows 用户)。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-09-15
  • 2011-09-14
  • 1970-01-01
  • 2021-11-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多