Ex_docs to generate specific modules only

I have a small set of functions (like an API) that I want to “publish” as a helper page, and I thought of using ex_docs to generate the page and in that sense I would manage the information presented using @doc in the code with less effort than managing a HTML page by hand everytime I make some changes.
Can I use ex_docs for it?
Can I only publish in some area of a production webiste the documentation for just some selected modules?
I couldn’t find this info in the ex_docs lib, so I don’t know if that is even advised to do, as it is usually done in [only: :dev] mode.
Thank you in advance.

For restricting the modules that are included in the documentation, you can use the :filter_modules option (mix docs — ExDoc v0.28.5)

I suppose there’s nothing preventing you from running mix docs in production as part of your assets generation task and placing the generated documentation under for example priv/static/docs or any other directory which is exposed by your webserver (you can use the :output option to control where the documentation is written).


Hi @trisolaran
Yes, that was it.
Thank you for pointing me the solution.

1 Like