defmodule MicrowavepropWeb.ApiDocsLive do @moduledoc "Renders `docs/api/README.md` as HTML at `/docs/api`." use MicrowavepropWeb, :live_view @external_resource "docs/api/README.md" @docs_html "docs/api/README.md" |> File.read!() |> Microwaveprop.Markdown.to_html!() @impl true def mount(_params, _session, socket) do {:ok, assign(socket, page_title: "API Documentation", content: @docs_html)} end @impl true def render(assigns) do ~H"""
{raw(@content)}
""" end end