Allow adding *.exs files to the docs
mat-hek opened this issue · 2 comments
mat-hek commented
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?
josevalim commented
There are no plans. You can always include it inside the markdown. :)
zachdaniel commented
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.