"""
end
# The whole page has to load and then hooks are mounded.
# There may be a tiny delay before the markdown is rendered
# or and editors are mounted, so show neat placeholders immediately.
defp render_markdown_content_placeholder("" = _content) do
assigns = %{}
~L"""
"""
end
defp render_markdown_content_placeholder(_content) do
assigns = %{}
~L"""
"""
end
defp render_editor_content_placeholder("" = _content) do
assigns = %{}
~L"""
"""
end
defp render_editor_content_placeholder(_content) do
assigns = %{}
~L"""
"""
end
defp render_outputs(outputs) do
assigns = %{outputs: outputs}
~L"""
<%= for output <- Enum.reverse(@outputs) do %>
<%= render_output(output) %>
<% end %>
"""
end
defp render_output(output) when is_binary(output) do
assigns = %{output: output}
~L"""
<%= @output %>
"""
end
defp render_output({:ok, value}) do
inspected = Utils.inspect_as_html(value, pretty: true, width: 100)
assigns = %{inspected: inspected}
~L"""
<%= @inspected %>
"""
end
defp render_output({:error, kind, error, stacktrace}) do
formatted = Exception.format(kind, error, stacktrace)
assigns = %{formatted: formatted}
~L"""
<%= @formatted %>
"""
end
defp render_cell_status(%{evaluation_status: :evaluating}) do
assigns = %{}
~L"""
Evaluating
"""
end
defp render_cell_status(%{evaluation_status: :queued}) do
assigns = %{}
~L"""
Queued
"""
end
defp render_cell_status(%{validity_status: :evaluated}) do
assigns = %{}
~L"""
Evaluated
"""
end
defp render_cell_status(%{validity_status: :stale}) do
assigns = %{}
~L"""