First off, this project is super awesome! I love being able to have always up to date mermaid diagrams for my Ecto schemas.
I am currently using this library to generate mermaid diagrams in ex_doc. I think this usage is pretty common, but it's not documented and the API is a little verbose.
I can get mermaid diagrams outputted like so:
@moduledoc """
This is information about our `ATcms.Account` context.
#{ATcms.Account.UserSchema |> Code.ensure_loaded!() |> then(fn _ -> "" end)}
` ` `mermaid
#{Ecto.ERD.Document.render([ATcms.Account.UserSchema], ".mmd", &Function.identity/1, [])}
` ` `
"""
We should document this use case so other people can enjoy the fun! Secondly, it would be awesome to clean up this code and make it easier to use. Something like Ecto.ERD.render([ATcms.Account.UserSchema], ".mmd") that would ensure the code is loaded and render out the modules to mermaid.
First off, this project is super awesome! I love being able to have always up to date mermaid diagrams for my Ecto schemas.
I am currently using this library to generate mermaid diagrams in ex_doc. I think this usage is pretty common, but it's not documented and the API is a little verbose.
I can get mermaid diagrams outputted like so:
We should document this use case so other people can enjoy the fun! Secondly, it would be awesome to clean up this code and make it easier to use. Something like
Ecto.ERD.render([ATcms.Account.UserSchema], ".mmd")that would ensure the code is loaded and render out the modules to mermaid.