ocaml - 从 utop 检索文档
问题描述
有没有办法 直接从 utop.xml检索文档,在此处以 html 显示。
我可以通过使用获取类型
utop # open Core;;
─( 10:41:50 )─< command 4 >─────────────────────────────────────────────────────────────────────────{ counter: 0 }─
utop # #typeof "In_channel.input_char";;
val Core.In_channel.input_char : Core.In_channel.t -> Base.char Base.option
─( 10:41:54 )─< command 5 >─────────────────────────────────────────────────────────────────────────{ counter: 0 }─
或者
utop # #show In_channel.input_char;;
val input_char : in_channel -> char option
─( 10:43:00 )─< command 7 >────────────────────────────────────────────────────────────{ counter: 0 }─
utop #
但文档更丰富
val input_char : t ‑> Stdio__.Import.char Stdio__.Import.option
Read one character from the given input channel.
Return None if there are no more characters to read.
解决方案
如果你想直接从 utop 获取文档,你可以从 opam 安装这个包:https ://github.com/reynir/ocp-index-top
然后#doc
将提供一个指令,并向您展示您想要的内容。
另一种方法是使用 ocp-browser。这可以显示所有类型和文档。
推荐阅读
- dart - 我可以从 json 字符串创建一个 const 对象吗?
- android - Android 设备上的像素溢出 - Flutter
- f# - F# 是否具有与 Haskell 相同的类型和数据构造函数定义?
- unity3d - Unity WebGL 卡在使用 localhost 服务器加载页面(无错误)
- javascript - 如何在nodejs中生成aws s3签名
- data-structures - 我可以在 Octave 中更改数据结构中的字段名称吗?
- css - 使用 CSS 在 HTML 上创建线指南
- windows - 用于激活 MS Office 的 Powershell 脚本
- python - 如何处理具有多种数据类型的熊猫数据框中的列?
- c++ - 如何删除动态分配的二维数组?