Repository: livebook-dev/kino
Pull request #463 (2024-08-03 22:47:18)

Fix various typos and improve language
Thank you for reviewing.


Patch:
diff --git a/lib/kino.ex b/lib/kino.ex
index bb5066f..74a872c 100644
--- a/lib/kino.ex
+++ b/lib/kino.ex
@@ -170,7 +170,7 @@ defmodule Kino do
   The callback receives a stream element and the accumulated state
   and it should return either of:
 
-    * `{:cont, term_to_render, state}` - the continue
+    * `{:cont, term_to_render, state}` - to continue
 
     * `:halt` - to no longer schedule callback evaluation
 
@@ -276,7 +276,7 @@ defmodule Kino do
 
   The callback should return either of:
 
-    * `{:cont, state}` - the continue
+    * `{:cont, state}` - to continue
 
     * `:halt` - to stop listening
 
@@ -536,16 +536,16 @@ defmodule Kino do
   end
 
   @doc """
-  Recompiles dependenies.
+  Recompiles dependencies.
 
   Once you have installed dependencies with `Mix.install/1`, this will
   recompile any outdated path dependencies declared during the install.
 
-  > #### Reproducability {: .warning}
+  > #### Reproducibility {: .warning}
   >
   > Keep in mind that recompiling dependency modules is **not** going
   > to mark any cells as stale. This means that the given notebook
-  > state may no longer be reproducable. This function is meant as a
+  > state may no longer be reproducible. This function is meant as a
   > utility when prototyping alongside a Mix project.
   """
   @spec recompile() :: :ok
diff --git a/lib/kino/audio.ex b/lib/kino/audio.ex
index 245bd74..3861ac0 100644
--- a/lib/kino/audio.ex
+++ b/lib/kino/audio.ex
@@ -22,7 +22,7 @@ defmodule Kino.Audio do
   @doc """
   Creates a new kino displaying the given binary audio.
 
-  The given type be either `:wav`, `:mp3`/`:mpeg`, `:ogg`
+  The given type can be either `:wav`, `:mp3`/`:mpeg`, `:ogg`
   or a string with audio MIME type.
 
   ## Options
diff --git a/lib/kino/bridge.ex b/lib/kino/bridge.ex
index 1e64856..4986c5a 100644
--- a/lib/kino/bridge.ex
+++ b/lib/kino/bridge.ex
@@ -86,7 +86,7 @@ defmodule Kino.Bridge do
   end
 
   @doc """
-  Requests the file path for notebook file with the given name.
+  Requests the file path for the notebook file with the given name.
   """
   @spec get_file_entry_path(String.t()) ::
           {:ok, term()} | {:error, :forbidden} | {:error, String.t()} | request_error()
@@ -95,7 +95,7 @@ defmodule Kino.Bridge do
   end
 
   @doc """
-  Requests the file spec for notebook file with the given name.
+  Requests the file spec for the notebook file with the given name.
   """
   @spec get_file_entry_spec(String.t()) ::
           {:ok, term()} | {:error, :forbidden} | {:error, String.t()} | request_error()
diff --git a/lib/kino/image.ex b/lib/kino/image.ex
index 2fa7297..1e7afdf 100644
--- a/lib/kino/image.ex
+++ b/lib/kino/image.ex
@@ -26,7 +26,7 @@ defmodule Kino.Image do
   @doc """
   Creates a new kino displaying the given binary image.
 
-  The given type be either `:jpeg`/`:jpg`, `:png`, `:gif`, `:svg`, `:pixel`
+  The given type can be either `:jpeg`/`:jpg`, `:png`, `:gif`, `:svg`, `:pixel`
   or a string with image MIME type.
 
   ## Pixel data
diff --git a/lib/kino/input.ex b/lib/kino/input.ex
index 9311652..351e76c 100644
--- a/lib/kino/input.ex
+++ b/lib/kino/input.ex
@@ -137,7 +137,7 @@ defmodule Kino.Input do
   @doc """
   Creates a new number input.
 
-  The input value is can be either a number or `nil`.
+  The input value can be either a number or `nil`.
 
   ## Options
 
@@ -519,7 +519,7 @@ defmodule Kino.Input do
 
   > #### Warning {: .warning}
   >
-  > The image input is shared by default: once you upload a image,
+  > The image input is shared by default: once you upload an image,
   > the image will be replicated to all users reading the notebook.
   > Use `Kino.Control.form/2` if you want each user to have a distinct
   > image upload with an explicit submission button.
diff --git a/lib/kino/render.ex b/lib/kino/render.ex
index ae63770..cb6ad01 100644
--- a/lib/kino/render.ex
+++ b/lib/kino/render.ex
@@ -33,7 +33,7 @@ defprotocol Kino.Render do
         def to_livebook(graph) do
           source = Graph.to_mermaid(graph)
           mermaid_kino = Kino.Mermaid.new(source)
-          inspect_kino = Kino.Inspect.new(image)
+          inspect_kino = Kino.Inspect.new(graph)
           kino = Kino.Layout.tabs(Graph: mermaid_kino, Raw: inspect_kino)
           Kino.Render.to_livebook(kino)
         end
diff --git a/lib/kino/shorts.ex b/lib/kino/shorts.ex
index 7cb0383..95d1dad 100644
--- a/lib/kino/shorts.ex
+++ b/lib/kino/shorts.ex
@@ -481,7 +481,7 @@ defmodule Kino.Shorts do
 
   > #### Warning {: .warning}
   >
-  > The image input is shared by default: once you upload a image,
+  > The image input is shared by default: once you upload an image,
   > the image will be replicated to all users reading the notebook.
   > Use `Kino.Control.form/2` if you want each user to have a distinct
   > image upload with an explicit submission button.
diff --git a/lib/kino/video.ex b/lib/kino/video.ex
index 2575d70..9816352 100644
--- a/lib/kino/video.ex
+++ b/lib/kino/video.ex
@@ -23,7 +23,7 @@ defmodule Kino.Video do
   @doc """
   Creates a new kino displaying the given binary video.
 
-  The given type be either `:mp4`, `:ogg`, `:avi`, `:wmv`, `:mov`
+  The given type can be either `:mp4`, `:ogg`, `:avi`, `:wmv`, `:mov`
   or a string with video MIME type.
 
   ## Options
@@ -79,6 +79,6 @@ defmodule Kino.Video do
 
   defp mime_type!(other) do
     raise ArgumentError,
-          "expected video type to be either :mp4, :ogg, :avi, :wmv, :mov, or an video MIME type string, got: #{inspect(other)}"
+          "expected video type to be either :mp4, :ogg, :avi, :wmv, :mov, or a video MIME type string, got: #{inspect(other)}"
   end
 end


Test patch:
diff --git a/test/kino/attribute_store_test.exs b/test/kino/attribute_store_test.exs
index a4c0fb0..94de0e2 100644
--- a/test/kino/attribute_store_test.exs
+++ b/test/kino/attribute_store_test.exs
@@ -1,4 +1,4 @@
-defmodule Kino.AttributeStoreTets do
+defmodule Kino.AttributeStoreTest do
   use ExUnit.Case, async: true
 
   alias Kino.AttributeStore
diff --git a/test/kino/process_test.exs b/test/kino/process_test.exs
index e493654..ca81eb8 100644
--- a/test/kino/process_test.exs
+++ b/test/kino/process_test.exs
@@ -176,7 +176,7 @@ defmodule Kino.ProcessTest do
   end
 
   describe "seq_trace/2" do
-    # Process.set_label/1 was addeed in Elixir 1.17.0
+    # Process.set_label/1 was added in Elixir 1.17.0
     if function_exported?(Process, :set_label, 1) do
       test "uses process label to identify a process" do
         process_label = "ponger"
diff --git a/test/kino/video_test.exs b/test/kino/video_test.exs
index 5f3a6a4..c3990d9 100644
--- a/test/kino/video_test.exs
+++ b/test/kino/video_test.exs
@@ -4,7 +4,7 @@ defmodule Kino.VideoTest do
   describe "new/2" do
     test "raises an error for a non-image MIME type" do
       assert_raise ArgumentError,
-                   ~s{expected video type to be either :mp4, :ogg, :avi, :wmv, :mov, or an video MIME type string, got: "application/json"},
+                   ~s{expected video type to be either :mp4, :ogg, :avi, :wmv, :mov, or a video MIME type string, got: "application/json"},
                    fn ->
                      Kino.Video.new(<<>>, "application/json")
                    end
@@ -12,7 +12,7 @@ defmodule Kino.VideoTest do
 
     test "raises an error for an invalid type shorthand" do
       assert_raise ArgumentError,
-                   "expected video type to be either :mp4, :ogg, :avi, :wmv, :mov, or an video MIME type string, got: :invalid",
+                   "expected video type to be either :mp4, :ogg, :avi, :wmv, :mov, or a video MIME type string, got: :invalid",
                    fn ->
                      Kino.Video.new(<<>>, :invalid)
                    end