The Elixir documentation generator tool ex_doc
doesn't accept a mix.exs
file as a configuration file
(probably because you can't compile it without editing it). This script opens the local mix.exs
file,
reads all the necessary portions, and finds some other info, and then prints out all the necessary
ex_doc
options to a config file.
This allows you to autogenerate docs without doing any (repetitive) lifting. If you have a whole bunch of projects,
adding ex_doc
to deps
is a pain. You can use the command line version of ex_doc
instead, but there are
a whole bunch of command line arguments that get in your way. The way around this is the sparsely documented
config
command line option, but,
frustratingly, you can't just use a mix.exs
file as that config. This tool converts that for you.
Drop this in to your project's root folder (same level as mix.exs
and mix.lock
) and run
$ elixir -r mix_to_ex_doc_config.exs