Ana*_*kov 2 documentation elixir-mix elixir
如何为混合项目生成文档?怎么做呢?
使用Elixir混合项目的过程:
mix new greeter命令生成一个项目。 greeter.ex文件中添加了一块注释。 mix.exs文件中。 mix docs
命令生成文档。mix help 无法docs在可能的选项列表中提供任务:
mix # Runs the default task (current: "mix run")
mix app.start # Starts all registered apps
mix app.tree # Prints the application tree
mix archive # Lists installed archives
mix archive.build # Archives this project into a .ez file
mix archive.install # Installs an archive locally
mix archive.uninstall # Uninstalls archives
mix clean # Deletes generated application files
mix cmd # Executes the given command
mix compile # Compiles source files
mix deps # Lists dependencies and their status
mix deps.clean # Deletes the given dependencies' files
mix deps.compile # Compiles dependencies
mix deps.get # Gets all out of date dependencies
mix deps.tree # Prints the dependency tree
mix deps.unlock # Unlocks the given dependencies
mix deps.update # Updates the given dependencies
mix dialyzer # Runs dialyzer with default or project-defined flags.
mix dialyzer.build # Build the required plt(s) and exit.
mix dialyzer.clean # Delete plt(s) and exit.
mix dialyzer.explain # Display information about dialyzer warnings.
mix do # Executes the tasks separated by comma
mix escript # Lists installed escripts
Run Code Online (Sandbox Code Playgroud)
当我运行mix docs命令时,我得到一个混合消息:
**(Mix) The task "docs" could not be found. Did you mean "do"?
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
earmark 1.3.2
ex_doc 0.20.2
makeup 0.8.0
makeup_elixir 0.13.0
nimble_parsec 0.5.0
All dependencies are up to date
Run Code Online (Sandbox Code Playgroud)
我怎么了
The mix docs task is available with ExDoc. Make sure that you have the dependency installed. Make sure to check out the docs and install it properly. Then you'll be able to use the mix docs command.
This is how to install it:
for Elixir >= 1.7:
def deps do
[
{:ex_doc, "~> 0.19", only: :dev, runtime: false},
]
end
Run Code Online (Sandbox Code Playgroud)
Elixir < 1.7:
def deps do
[
{:ex_doc, "~> 0.18.0", only: :dev, runtime: false},
]
end
Run Code Online (Sandbox Code Playgroud)
mix deps.getmix docsThere are things you can configure in the project function of your mix file. Such as the name, source_url and homepage_url. Make sure to check out ExDoc's documentation for more details.