gpt4 book ai didi

erlang - edoc 没有在 hrl 文件中生成所有文档类型?

转载 作者:行者123 更新时间:2023-12-02 03:47:30 24 4
gpt4 key购买 nike

我目前有三个文件:

临时文件.hrl

-export_type([temptype/0]).
-type temptype() :: string().
%% blah blah documentation

临时文件.erl

-module(tempfile).

... more code, but no references to the temptype() type.

random.erl

-module(random).
%% @headerfile "tempfile.hrl"
-include("tempfile.hrl").

-spec random() -> tempfile:temptype().

但是,当使用 edoc 时,没有出现 temptype() 的文档。出现指向 tempfile.html#temptype 的超链接,但它链接到任何地方。我什至尝试使用 -export_type 但这没有用...可能是什么问题?谢谢。

最佳答案

temptype() 不是模块临时文件的一部分。

您可以做的是将声明包含到临时文件模块中。

-export_type([temptype/0]).
-type temptype() :: string().

那时您不必拥有 tempfile.hrl。

=>

临时文件.erl

-module(tempfile).
-export_type([temptype/0]).
-type temptype() :: string().

随机数

-module(random).

-spec random() -> tempfile:temptype().

关于erlang - edoc 没有在 hrl 文件中生成所有文档类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16031807/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com