【发布时间】:2017-07-19 03:46:00
【问题描述】:
我昨天才开始学习灵药。我有一个文件 User.exs。它看起来像这样:
defmodule User do
@moduledoc """
Defines the user struct and functions to handle users.
"""
# functions and stuff go here...
end
当我运行 iex 时,当我尝试查看文档时会发生以下情况:
iex(1)> c "user.exs"
[User]
iex(2)> h User
User was not compiled with docs
有什么想法吗?
【问题讨论】:
-
将文件的扩展名改为
.ex。 -
@mudasobwa 问题依然存在,没有什么不同。
-
通常不会编译 .exs(它是一个脚本文件)。所以@mudasobwa 的建议是一个很好的建议。但如果你不使用混合文件,那么我建议你添加一个。
标签: documentation elixir elixir-iex