Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various typos and improve language #463

Merged
merged 5 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/kino.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/kino/audio.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/kino/bridge.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion lib/kino/image.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/kino/input.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/kino/render.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/kino/shorts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/kino/video.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/kino/attribute_store_test.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Kino.AttributeStoreTets do
defmodule Kino.AttributeStoreTest do
use ExUnit.Case, async: true

alias Kino.AttributeStore
Expand Down
2 changes: 1 addition & 1 deletion test/kino/process_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions test/kino/video_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
use Kino.LivebookCase, async: true

describe "new/2" do
test "raises an error for a non-image MIME type" do

Check failure on line 5 in test/kino/video_test.exs

View workflow job for this annotation

GitHub Actions / main (1.15.5, 26.0.2, true)

test new/2 raises an error for a non-image MIME type (Kino.VideoTest)
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"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to adjust the raising code also :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True!

fn ->
Kino.Video.new(<<>>, "application/json")
end
end

test "raises an error for an invalid type shorthand" do

Check failure on line 13 in test/kino/video_test.exs

View workflow job for this annotation

GitHub Actions / main (1.15.5, 26.0.2, true)

test new/2 raises an error for an invalid type shorthand (Kino.VideoTest)
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
Expand Down
Loading