I’m trying to add an ascii diagram to a @moduledoc, but when I generate the docs using ex_docs’s mix docs, the output doesn’t look well because of the non-monospace font it’s using.
@moduledoc
ex_docs
mix docs
Is there any way I can tell the docs to use a monospace font here?
┌──────┐ │ User │ └──────┘ ◆ │ ┌──────────┐ │ Settings │ └──────────┘
You could use the :assets config option to provide your own CSS and use the :before_closing_head_tag to call that CSS into your docs.
:assets
:before_closing_head_tag
See mix docs — ex_doc v0.24.2
Alternatively, as docs are rendered using markdown, you should be able to output a code block by indenting your diagram with four spaces.
Thanks, you definitely pointed me in the right direction. For anyone interested, I found this link very useful: https://medium.com/@takanori.ishikawa/customize-how-your-exdoc-documentation-looks-a10234dbb4c9