elixir-lang/ex_doc

Allow adding *.exs files to the docs

mat-hek opened this issue · 2 comments

Hi, I'd like to add an .exs example to the docs as a separate page and it seems only .md, .livemd and .cheatmd are supported. Could .exs files be supported too?

There are no plans. You can always include it inside the markdown. :)

My suggestion would be to make a mix task that copies the .exs into a markdown file (i.e File.read! and File.write!), and then add an alias to your mix.exs file,

defp aliases do
  [
    docs: ["your_task", "docs"]
  ]
end

We do this for pre-processing docs in Ash and it works nicely, and mix hex.publish picks it up automatically.