mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-11 07:24:30 +08:00
Fix various typos and improve language (#2728)
This commit is contained in:
parent
0df5415020
commit
02e89c19cf
21 changed files with 25 additions and 27 deletions
|
@ -71,7 +71,7 @@ defmodule Livebook.Apps do
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Subscribes to update in apps list.
|
Subscribes to updates in the apps list.
|
||||||
|
|
||||||
## Messages
|
## Messages
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ defprotocol Livebook.FileSystem do
|
||||||
@typedoc """
|
@typedoc """
|
||||||
An identifier uniquely identifying the given file system.
|
An identifier uniquely identifying the given file system.
|
||||||
|
|
||||||
Every file system struct is expected have an `:id` field.
|
Every file system struct is expected to have an `:id` field.
|
||||||
|
|
||||||
The identifier should be computed deterministically based on the
|
The identifier should be computed deterministically based on the
|
||||||
specific resource used as the file system. This ensures that
|
specific resource used as the file system. This ensures that
|
||||||
|
@ -18,12 +18,12 @@ defprotocol Livebook.FileSystem do
|
||||||
@type id :: String.t()
|
@type id :: String.t()
|
||||||
|
|
||||||
@typedoc """
|
@typedoc """
|
||||||
A path uniquely identifies file in the file system.
|
A path uniquely identifies a file in the file system.
|
||||||
|
|
||||||
Path has most of the semantics of regular file paths, with the
|
Path has most of the semantics of regular file paths, with the
|
||||||
following exceptions:
|
following exceptions:
|
||||||
|
|
||||||
* path must be be absolute for consistency
|
* path must be absolute for consistency
|
||||||
|
|
||||||
* directory path must have a trailing slash, whereas regular file
|
* directory path must have a trailing slash, whereas regular file
|
||||||
path must not have a trailing slash. Rationale: certain file
|
path must not have a trailing slash. Rationale: certain file
|
||||||
|
|
|
@ -28,8 +28,8 @@ defmodule Livebook.FileSystem.S3.Client do
|
||||||
"""
|
"""
|
||||||
@spec get_bucket_name(S3.t()) :: {:ok, String.t()} | {:error, String.t()}
|
@spec get_bucket_name(S3.t()) :: {:ok, String.t()} | {:error, String.t()}
|
||||||
def get_bucket_name(file_system) do
|
def get_bucket_name(file_system) do
|
||||||
# We have bucket URL, but it's not straightforward to extract
|
# We have the bucket URL, but it's not straightforward to extract
|
||||||
# bucket name from the URL, because it may be either the path
|
# the bucket name from the URL, because it may be either the path
|
||||||
# or a part of the host.
|
# or a part of the host.
|
||||||
#
|
#
|
||||||
# Endpoints that return bucket information doesn't include the
|
# Endpoints that return bucket information doesn't include the
|
||||||
|
|
|
@ -147,7 +147,7 @@ defmodule Livebook.Hubs.Personal do
|
||||||
@doc """
|
@doc """
|
||||||
Gets a file system from storage.
|
Gets a file system from storage.
|
||||||
|
|
||||||
Raises `RuntimeError` if the secret doesn't exist.
|
Raises `RuntimeError` if the file system does not exist.
|
||||||
"""
|
"""
|
||||||
@spec fetch_file_system!(String.t()) :: FileSystem.t()
|
@spec fetch_file_system!(String.t()) :: FileSystem.t()
|
||||||
def fetch_file_system!(id) do
|
def fetch_file_system!(id) do
|
||||||
|
|
|
@ -31,7 +31,7 @@ defmodule Livebook.LiveMarkdown do
|
||||||
# * notebook, section or cell metadata
|
# * notebook, section or cell metadata
|
||||||
#
|
#
|
||||||
# * `{"force_markdown":true}` - an annotation forcing the next
|
# * `{"force_markdown":true}` - an annotation forcing the next
|
||||||
# next Markdown block to be treated as part of Markdown cell
|
# Markdown block to be treated as part of Markdown cell
|
||||||
# (relevant for Elixir/Erlang code blocks, which otherwise
|
# (relevant for Elixir/Erlang code blocks, which otherwise
|
||||||
# are interpreted as Code cells)
|
# are interpreted as Code cells)
|
||||||
#
|
#
|
||||||
|
|
|
@ -932,7 +932,7 @@ defmodule Livebook.Notebook do
|
||||||
{:cont, :ok}
|
{:cont, :ok}
|
||||||
|
|
||||||
{:error, error} ->
|
{:error, error} ->
|
||||||
{:halt, {:error, "failed to copy notebok file #{file_entry.name}, #{error}"}}
|
{:halt, {:error, "failed to copy notebook file #{file_entry.name}, #{error}"}}
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
|
@ -71,7 +71,7 @@ defmodule Livebook.Notebook.Cell do
|
||||||
def find_inputs_in_output(_output), do: []
|
def find_inputs_in_output(_output), do: []
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Extract all asset infos from the given non-indexed output.
|
Extracts all asset infos from the given non-indexed output.
|
||||||
"""
|
"""
|
||||||
@spec find_assets_in_output(Livebook.Runtime.output()) :: list(asset_info :: map())
|
@spec find_assets_in_output(Livebook.Runtime.output()) :: list(asset_info :: map())
|
||||||
def find_assets_in_output(output)
|
def find_assets_in_output(output)
|
||||||
|
|
|
@ -8,7 +8,7 @@ defmodule Livebook.Notebook.Cell.Smart do
|
||||||
# access and take over the underlying code at any point.
|
# access and take over the underlying code at any point.
|
||||||
#
|
#
|
||||||
# The available smart cells come from the runtime, therefore they
|
# The available smart cells come from the runtime, therefore they
|
||||||
# are one Livebook's extension points.
|
# are one of Livebook's extension points.
|
||||||
|
|
||||||
defstruct [
|
defstruct [
|
||||||
:id,
|
:id,
|
||||||
|
|
|
@ -49,7 +49,7 @@ defmodule Livebook.Notebook.ContentLoader do
|
||||||
defp do_rewrite_url(uri), do: uri
|
defp do_rewrite_url(uri), do: uri
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Loads binary content from the given URl and validates if its plain text.
|
Loads binary content from the given URL and validates if it's plain text.
|
||||||
"""
|
"""
|
||||||
@spec fetch_content(String.t()) :: {:ok, String.t()} | {:error, String.t()}
|
@spec fetch_content(String.t()) :: {:ok, String.t()} | {:error, String.t()}
|
||||||
def fetch_content(url) do
|
def fetch_content(url) do
|
||||||
|
|
|
@ -8,10 +8,10 @@ defmodule Livebook.Runtime.Evaluator do
|
||||||
#
|
#
|
||||||
# Storing the binding in the same process that evaluates the code is
|
# Storing the binding in the same process that evaluates the code is
|
||||||
# essential, because otherwise we would have to send it to another
|
# essential, because otherwise we would have to send it to another
|
||||||
# process, which means copying a potentially massive amounts of data.
|
# process, which means copying potentially massive amounts of data.
|
||||||
#
|
#
|
||||||
# Also, note that this process intentionally is not a GenServer,
|
# Also, note that this process intentionally is not a GenServer,
|
||||||
# because during evaluation we it may receive arbitrary messages
|
# because during evaluation it may receive arbitrary messages
|
||||||
# and we want to keep them in the inbox, whereas a GenServer would
|
# and we want to keep them in the inbox, whereas a GenServer would
|
||||||
# always consume them.
|
# always consume them.
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ defmodule Livebook.Runtime.Evaluator do
|
||||||
# would take too much memory
|
# would take too much memory
|
||||||
@evaluator_info_key :evaluator_info
|
@evaluator_info_key :evaluator_info
|
||||||
|
|
||||||
# We stor the path in process dictionary, so that the tracer can access it
|
# We store the path in the process dictionary, so that the tracer can access it.
|
||||||
@ebin_path_key :ebin_path
|
@ebin_path_key :ebin_path
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
|
|
|
@ -10,7 +10,7 @@ defmodule Livebook.Users do
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Updates an User from given changeset.
|
Updates a User from given changeset.
|
||||||
|
|
||||||
With success, notifies interested processes about user data change.
|
With success, notifies interested processes about user data change.
|
||||||
Otherwise, it will return an error tuple with changeset.
|
Otherwise, it will return an error tuple with changeset.
|
||||||
|
|
|
@ -84,7 +84,7 @@ defmodule Livebook.Utils.HTTP do
|
||||||
@doc """
|
@doc """
|
||||||
Downloads resource at the given URL into `collectable`.
|
Downloads resource at the given URL into `collectable`.
|
||||||
|
|
||||||
If collectable raises and error, it is rescued and an error tuple
|
If collectable raises an error, it is rescued and an error tuple
|
||||||
is returned.
|
is returned.
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
|
@ -108,8 +108,6 @@ defmodule LivebookWeb.CoreComponents do
|
||||||
|
|
||||||
slot :inner_block
|
slot :inner_block
|
||||||
|
|
||||||
def message_box(assigns)
|
|
||||||
|
|
||||||
def message_box(assigns) do
|
def message_box(assigns) do
|
||||||
if assigns.message && assigns.inner_block != [] do
|
if assigns.message && assigns.inner_block != [] do
|
||||||
raise ArgumentError, "expected either message or inner_block, got both."
|
raise ArgumentError, "expected either message or inner_block, got both."
|
||||||
|
|
|
@ -2,7 +2,7 @@ defmodule LivebookWeb.NotebookComponents do
|
||||||
use LivebookWeb, :html
|
use LivebookWeb, :html
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Renders an learn notebook card.
|
Renders a learn notebook card.
|
||||||
"""
|
"""
|
||||||
attr :notebook_info, :map, required: true
|
attr :notebook_info, :map, required: true
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ defmodule LivebookWeb.ANSIHelpers do
|
||||||
@doc """
|
@doc """
|
||||||
Converts a string with ANSI escape codes into HTML lines.
|
Converts a string with ANSI escape codes into HTML lines.
|
||||||
|
|
||||||
Same as `ansi_string_to_html_lines_step/1`, but allows
|
Same as `ansi_string_to_html_lines/1`, but allows
|
||||||
for keeping track of modifiers for stream usage.
|
for keeping track of modifiers for stream usage.
|
||||||
"""
|
"""
|
||||||
@spec ansi_string_to_html_lines_step(String.t(), Livebook.Utils.ANSI.modifiers()) ::
|
@spec ansi_string_to_html_lines_step(String.t(), Livebook.Utils.ANSI.modifiers()) ::
|
||||||
|
|
|
@ -37,7 +37,7 @@ defmodule LivebookWeb.AppAuthLive do
|
||||||
<a
|
<a
|
||||||
class="border-b border-gray-700 hover:border-none"
|
class="border-b border-gray-700 hover:border-none"
|
||||||
href={~p"/authenticate?redirect_to=#{@authenticated_path}"}
|
href={~p"/authenticate?redirect_to=#{@authenticated_path}"}
|
||||||
>login into Livebook</a>.
|
>log in to Livebook</a>.
|
||||||
</div>
|
</div>
|
||||||
<div class="text-2xl text-gray-800 w-full pt-2">
|
<div class="text-2xl text-gray-800 w-full pt-2">
|
||||||
<form class="flex flex-col space-y-4 items-center" phx-submit="authenticate">
|
<form class="flex flex-col space-y-4 items-center" phx-submit="authenticate">
|
||||||
|
|
|
@ -88,7 +88,7 @@ defmodule LivebookWeb.Hub.Teams.DeploymentGroupComponent do
|
||||||
</span>
|
</span>
|
||||||
</.labeled_text>
|
</.labeled_text>
|
||||||
</div>
|
</div>
|
||||||
<!-- Aditional Secrets -->
|
<!-- Additional Secrets -->
|
||||||
<div id={"secrets-group-#{@deployment_group.id}"} class="flex flex-col space-y-4 mt-6">
|
<div id={"secrets-group-#{@deployment_group.id}"} class="flex flex-col space-y-4 mt-6">
|
||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
|
|
|
@ -83,7 +83,7 @@ defmodule Livebook.Apps.PathAppSpecTest do
|
||||||
app_spec = %Livebook.Apps.PathAppSpec{slug: slug, path: app_path}
|
app_spec = %Livebook.Apps.PathAppSpec{slug: slug, path: app_path}
|
||||||
|
|
||||||
assert {:error, message} = Livebook.Apps.AppSpec.load(app_spec, file_tmp_path)
|
assert {:error, message} = Livebook.Apps.AppSpec.load(app_spec, file_tmp_path)
|
||||||
assert message == "failed to copy notebok file image.jpg, no such file or directory"
|
assert message == "failed to copy notebook file image.jpg, no such file or directory"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -245,7 +245,7 @@ defmodule Livebook.LiveMarkdown.ImportTest do
|
||||||
assert ["downgrading all headings, because 2 instances of heading 1 were found"] == messages
|
assert ["downgrading all headings, because 2 instances of heading 1 were found"] == messages
|
||||||
end
|
end
|
||||||
|
|
||||||
test "preserves markdown modifiers in notebok/section names" do
|
test "preserves markdown modifiers in notebook/section names" do
|
||||||
markdown = """
|
markdown = """
|
||||||
# My *Notebook*
|
# My *Notebook*
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ defmodule Livebook.LiveMarkdown.MarkdownHelpersTest do
|
||||||
|
|
||||||
test "paragraph" do
|
test "paragraph" do
|
||||||
markdown = """
|
markdown = """
|
||||||
First paragrpah.
|
First paragraph.
|
||||||
|
|
||||||
Second paragraph.\
|
Second paragraph.\
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -39,7 +39,7 @@ defmodule Livebook.Runtime.Evaluator.ObjectTrackerTest do
|
||||||
refute_received :object1_released
|
refute_received :object1_released
|
||||||
end
|
end
|
||||||
|
|
||||||
test "remove_reference_sync/2 awaits for monitor acknowledgements",
|
test "remove_reference_sync/2 awaits for monitor acknowledgments",
|
||||||
%{object_tracker: object_tracker} do
|
%{object_tracker: object_tracker} do
|
||||||
ObjectTracker.add_reference(object_tracker, :object1, {self(), :ref1})
|
ObjectTracker.add_reference(object_tracker, :object1, {self(), :ref1})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue