Update non-formatted interpolation syntax

This commit is contained in:
Jonatan Kłosko 2024-12-05 17:14:34 +08:00
parent 8fdbf77bc8
commit 68cc30f173
17 changed files with 25 additions and 25 deletions

View file

@ -62,7 +62,7 @@ defmodule LivebookWeb.CoreComponents do
/>
<.remix_icon :if={@kind == "warning"} icon="alert-fill" class="text-xl text-yellow-500" />
<.remix_icon :if={@kind == "error"} icon="error-warning-fill" class="text-xl text-red-500" />
<span class="whitespace-pre-wrap pr-2 max-h-52 overflow-y-auto tiny-scrollbar" phx-no-format><%= message %></span>
<span class="whitespace-pre-wrap pr-2 max-h-52 overflow-y-auto tiny-scrollbar" phx-no-format>{message}</span>
</div>
"""
end
@ -125,7 +125,7 @@ defmodule LivebookWeb.CoreComponents do
:if={@message}
class="whitespace-pre-wrap pr-2 max-h-52 overflow-y-auto tiny-scrollbar"
phx-no-format
><%= @message %></div>
>{@message}</div>
<%= if @inner_block != [] do %>
{render_slot(@inner_block)}
<% end %>
@ -516,7 +516,7 @@ defmodule LivebookWeb.CoreComponents do
id={"#{@source_id}-highlight"}
phx-hook="Highlight"
data-p-language={hook_prop(@language)}
><div id={@source_id} data-source><%= @source %></div><div data-target></div></code></pre>
><div id={@source_id} data-source>{@source}</div><div data-target></div></code></pre>
</div>
"""
end
@ -734,7 +734,7 @@ defmodule LivebookWeb.CoreComponents do
## Examples
<.listing items={@packages}>
<:item :let={package}><code><%= package.name %></code></:item>
<:item :let={package}><code>{package.name}</code></:item>
<:singular_suffix>package</:singular_suffix>
<:plural_suffix>packages</:plural_suffix>
</.listing>
@ -774,8 +774,8 @@ defmodule LivebookWeb.CoreComponents do
## Examples
<.table id="users" rows={@users}>
<:col :let={user} label="id"><%= user.id %></:col>
<:col :let={user} label="username"><%= user.username %></:col>
<:col :let={user} label="id">{user.id}</:col>
<:col :let={user} label="username">{user.username}</:col>
</.table>
"""

View file

@ -80,7 +80,7 @@ defmodule LivebookWeb.FormComponents do
@class
]}
{@rest}
><%= Phoenix.HTML.Form.normalize_value("textarea", @value) %></textarea>
>{Phoenix.HTML.Form.normalize_value("textarea", @value)}</textarea>
</.field_wrapper>
"""
end

View file

@ -195,7 +195,7 @@ defmodule LivebookWeb.SessionHelpers do
assigns = %{notebook_name: session.notebook_name, file: session.file}
description = ~H"""
Are you sure you want to close this session - <span class="font-semibold"><%= @notebook_name %></span>?
Are you sure you want to close this session - <span class="font-semibold">{@notebook_name}</span>?
<br />
<%= if @file do %>
This won't delete any persisted files.

View file

@ -165,7 +165,7 @@ defmodule LivebookWeb.FileSelectComponent do
class="mb-4 px-4 py-3 flex space-x-4 items-center border border-gray-200 rounded-lg"
>
<p class="grow text-gray-700 text-sm">
Are you sure you want to irreversibly delete <span class="font-semibold"><%= @deleting_file.path %></span>?
Are you sure you want to irreversibly delete <span class="font-semibold">{@deleting_file.path}</span>?
</p>
<div class="flex space-x-4">
<button

View file

@ -157,7 +157,7 @@ defmodule LivebookWeb.Hub.NewLive do
class="mr-4 text-brand-pink font-semibold text-xl leading-none"
id="clipboard-code"
phx-no-format
><%= @content %></div>
>{@content}</div>
<.icon_button phx-click={JS.dispatch("lb:clipcopy", to: "#clipboard-code")} type="button">
<.remix_icon icon="clipboard-line" />

View file

@ -78,7 +78,7 @@ defmodule LivebookWeb.Hub.SecretListComponent do
assigns = %{name: attrs["name"]}
description = ~H"""
Are you sure you want to delete this secret - <span class="font-semibold"><%= @name %></span>?
Are you sure you want to delete this secret - <span class="font-semibold">{@name}</span>?
"""
{:noreply,

View file

@ -400,7 +400,7 @@ defmodule LivebookWeb.Output do
role="complementary"
aria-label="error message"
phx-no-format
><%= @message %></div>
>{@message}</div>
"""
end
@ -415,7 +415,7 @@ defmodule LivebookWeb.Output do
role="complementary"
aria-label="error"
phx-no-format
><%= LivebookWeb.ANSIHelpers.ansi_string_to_html(@message) %></div>
>{LivebookWeb.ANSIHelpers.ansi_string_to_html(@message)}</div>
<div class="absolute right-2 top-0 z-10 invisible group-hover/error:visible">
<.icon_button phx-click={JS.dispatch("lb:clipcopy", to: "##{@id}-message")}>
<.remix_icon icon="clipboard-line" />

View file

@ -48,7 +48,7 @@ defmodule LivebookWeb.Output.MarkdownComponent do
class="text-gray-700 whitespace-pre-wrap hidden"
phx-update="stream"
phx-no-format
><span :for={{dom_id, chunk}<- @streams.chunks} id={dom_id}><%= chunk.text %></span></div>
><span :for={{dom_id, chunk}<- @streams.chunks} id={dom_id}>{chunk.text}</span></div>
<div data-content class="markdown" id={"#{@id}-content"} phx-update="ignore"></div>
</div>
"""

View file

@ -42,7 +42,7 @@ defmodule LivebookWeb.Output.PlainTextComponent do
phx-update="stream"
phx-no-format
><span
:for={{dom_id, chunk}<- @streams.chunks} id={dom_id}><%= chunk.text %></span></div>
:for={{dom_id, chunk}<- @streams.chunks} id={dom_id}>{chunk.text}</span></div>
"""
end
end

View file

@ -75,10 +75,10 @@ defmodule LivebookWeb.Output.TerminalTextComponent do
<div data-template class="hidden" id={"#{@id}-template"} phx-no-format><div
id={"#{@id}-template-append"}
phx-update="stream"
><div :for={{dom_id, html_line} <- @streams.html_lines} id={dom_id} data-line><%= [
><div :for={{dom_id, html_line} <- @streams.html_lines} id={dom_id} data-line>{[
html_line.html,
"\n"
] %></div></div><div data-line><%= @last_html_line %></div></div>
]}</div></div><div data-line>{@last_html_line}</div></div>
<div
data-content
class="overflow-auto whitespace-pre font-editor text-gray-500 tiny-scrollbar"

View file

@ -445,7 +445,7 @@ defmodule LivebookWeb.SessionLive do
assigns = %{section_name: section.name}
description = ~H"""
Are you sure you want to delete this section - <span class="font-semibold"><%= @section_name %></span>?
Are you sure you want to delete this section - <span class="font-semibold">{@section_name}</span>?
"""
confirm(socket, on_confirm,

View file

@ -63,7 +63,7 @@ defmodule LivebookWeb.SessionLive.AttachedRuntimeComponent do
Make sure to give the node a name and a cookie, for example:
</p>
<div class="text-gray-700 markdown">
<pre><code>iex --name <%= test_node() %> --cookie mycookie -S mix</code></pre>
<pre><code>iex --name {test_node()} --cookie mycookie -S mix</code></pre>
</div>
<p class="text-gray-700">
Then enter the connection information below:

View file

@ -291,7 +291,7 @@ defmodule LivebookWeb.SessionLive.FilesListComponent do
assigns = %{name: file_entry.name}
description = ~H"""
Are you sure you want to delete this file - <span class="font-semibold"><%= @name %></span>?
Are you sure you want to delete this file - <span class="font-semibold">{@name}</span>?
"""
{:noreply,

View file

@ -375,7 +375,7 @@ defmodule LivebookWeb.SessionLive.FlyRuntimeComponent do
class="px-4 py-3 flex space-x-4 items-center border border-gray-200 rounded-lg"
>
<p class="grow text-gray-700 text-sm">
Are you sure you want to irreversibly delete <span class="font-semibold"><%= @volume_id %></span>?
Are you sure you want to irreversibly delete <span class="font-semibold">{@volume_id}</span>?
</p>
<div class="flex space-x-4">
<button

View file

@ -307,7 +307,7 @@ defmodule LivebookWeb.SessionLive.K8sRuntimeComponent do
class="px-4 py-3 mt-4 flex space-x-4 items-center border border-gray-200 rounded-lg"
>
<p class="grow text-gray-700 text-sm">
Are you sure you want to irreversibly delete Persistent Volume Claim <span class="font-semibold"><%= @pvc_name %></span>?
Are you sure you want to irreversibly delete Persistent Volume Claim <span class="font-semibold">{@pvc_name}</span>?
</p>
<div class="flex space-x-4">
<button
@ -419,7 +419,7 @@ defmodule LivebookWeb.SessionLive.K8sRuntimeComponent do
<div>
Authenticated user has no permission to <span class="font-semibold">{@verb}</span>
<code>{@path}</code>
<span :if={@namespace}> in namespace <code><%= @namespace %></code> (or the namespace doesn't exist)</span>.
<span :if={@namespace}> in namespace <code>{@namespace}</code> (or the namespace doesn't exist)</span>.
</div>
</div>
"""

View file

@ -1310,7 +1310,7 @@ defmodule LivebookWeb.SessionLive.Render do
data-el-heading
spellcheck="false"
phx-no-format
><%= @data_view.notebook_name %></h1>
>{@data_view.notebook_name}</h1>
</div>
<.session_menu session={@session} />
</div>

View file

@ -47,7 +47,7 @@ defmodule LivebookWeb.SessionLive.SectionComponent do
data-el-heading
spellcheck="false"
phx-no-format
><%= @section_view.name %></h2>
>{@section_view.name}</h2>
<div
class="ml-4 flex space-x-2 items-center"
data-el-section-actions