ocaml - ocamldoc 无法使用 @param 正确显示参数名称或描述
问题描述
简单地说,假设我有以下 OCaml 文件,名为test.ml
:
(**
[Test] is a sample module for showing the problem I am having with @ tags with OCamlDoc
*)
(**
[id] is the identity function. For any argument [x], [id x] is [x].
@param x The argument, which will be returned
@return The argument [x]
*)
let id (x: 'a): 'a = x
如果我运行命令ocamldoc -html -all-params -colorize-code test.ml
来获取Test
模块的文档,我会得到以下结果:
可以看出,对于参数信息,它()
作为参数的名称,并且由于某种原因不包括对参数的描述。
我不确定为什么参数名称和描述没有正确显示。
解决方案
如果你写let id x = x
显示是正确的:
问题是,@param
如果您提供的标签与命名参数不匹配,但无法从(id : type)
.
这是一个已知的错误,但遗憾的是没有人碰过它...... https://github.com/ocaml/ocaml/issues/8804
推荐阅读
- jsp - 在 Java 类方法中传递 HTML 元素的动态值
- java - Hibernate - 重新创建一个表并从一个表中分配主键(开始)
- laravel - 从控制器传递到视图时不显示数据
- c# - 以编程方式恢复 nuget 包(.net 核心和 .net 框架)
- excel - 删除 .Select 和 .Activate
- java - Kotlin - Mockito 测试失败
- java - for 循环跳过扫描仪输入
- ios - Cordova-plugin-googlemaps 上的 SetIcon 在 iOS 上引发错误并且仅在第一次冻结屏幕
- arrays - 将列表中的每个元素相互比较并打印模式
- javascript - 阅读器加载功能未将分割线添加到预定义的数组