Because generating documentation is based on markdown, you have to do 2 things :
1/ Write your doctest and make your doctest examples clear to improve readability (It is better to give a headline, like "examples" or "tests"). When you write your tests, do not forget to give 4 spaces to your tests code so that it will be formatting as code in the HTML documentation.
2/ Then, enter "mix docs" in console at the root of your elixir project to generate the HTML documentation in the doc directory located in the root of your elixir project.
$> mix docs