![ConTeXt 命令列表](https://linux22.com/image/404840/ConTeXt%20%E5%91%BD%E4%BB%A4%E5%88%97%E8%A1%A8.png)
我如何才能获得“机器可读”版本的ConTeXt 命令列表?
理想情况下,我希望获得一个合理格式的 Lua 表,列出所有命令及其主要属性(例如参数名称及其分隔符、允许的键和值,以及(如果可能)一些文档)。例如:
{
alpha = {
symbol = "α",
arguments = {}
},
at = {
arguments = {
[1] = {meta = "text", optional = true},
[2] = {meta = "text", optional = true},
[3] = {meta = "reference", delimiters = {"[", "]"}}
},
summary = "Some short explanation, if available",
documentation = "Link to the ConTeXt reference manual or wiki"
},
commandwithkeyvaluearguments = {
arguments = {
[1] = {
meta = "options",
delimiters = {"[", "]"},
keys = {--[[table describing the possible keys and values]]},
}
},
summary = "Some short explanation, if available",
documentation = "Link to the ConTeXt reference manual or wiki"
},
...
}
这在计算代码补全和帮助的库中很有用,例如这个。
如果可以直接从本地 ConTeXt 安装计算此表texlua
,那就更好了。否则,包含数据的文件就可以完成这项工作。