开发者

Using LuaDoc with extensions other than .lua

I am currently developing lua scripts for a new application which requires the extension to be xx_lua. I have luadoc working fine for .lua extensions and I know I could simply rename the files to the lua extension create the documents and rename them back, but 开发者_Go百科personally I would prefer a more elegant solution.

Is is possible to get luadoc to look at other extensions. I have tried calling

luadoc_start *.xx_lua

but that results with no output even when there are plenty of files in the path with that extension.


If modifying luadoc is an option then you can do that. I just had a quick look at the 3.0.1 version (latest at the moment of writing this) and in src/luadoc/taglet/standard.lua there's line 406:

local patterns = { "%.lua$", "%.luadoc$" }

The pattern "%.lua" is used at two other locations (same file, line 316) and in src/luadoc/doclet/html.lua:53, that last one doesn't seem relevant. The right thing to do in my opinion would be to create a global parameter for filename extension and use it instead of the hardcoded ".lua". Maybe you can even submit a patch to luadoc and improve it for future programmers in your situation :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜