beacon_live_admin
beacon_live_admin copied to clipboard
Editor: Extend markdown to support HEEx features
Regular Markdown converter isn't capable of handling HEEx features. We want a subset of a regular Markdown that is capable of parsing and generating valid HEEx without losing features or breaking the compilation.
Function components
Beacon provides function components to display assets and will provide components for building pages, for eg:
<div>
<BeaconWeb.Components.image name="my_image.png" />
</div>
Using such component should generate the expected HTML tags as it would in a HEEx template.
Navigation
A regular markdown link should probably generate the same markup as <.link navigate=...">
to include the phx-*
attributes and allow it to transition pages efficiently, otherwise it triggers a redirect.
Research
MDX is a great solution for the JS ecosystem and we it can serve as inspiration to build something similar in Elixir.
The library md ~may be~ is capable of embedding heex but it doesn't support the CommonMark spec.
So a new library mdex was created to support what is needed for Beacon, but loading Phoenix Components is still a WIP.
Relates to improving blog posts experience