diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3af3573..e8479b4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,8 +1,9 @@ +name: Test + on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] env: MIX_ENV: test @@ -64,4 +65,4 @@ jobs: if: ${{ matrix.lint }} - name: Run tests - run: mix test \ No newline at end of file + run: mix test diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..613f782 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v0.1.0](https://github.com/livebook-dev/kino_slack/tree/v0.1.0) (2022-12-07) + +Initial release. diff --git a/README.md b/README.md index f93e49a..ba862e9 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,31 @@ # KinoSlack -**TODO: Add description** +[![Docs](https://img.shields.io/badge/hex.pm-docs-8e7ce6.svg)](https://hexdocs.pm/kino_slack) +[![Actions Status](https://github.com/livebook-dev/kino_slack/workflows/Test/badge.svg)](https://github.com/livebook-dev/kino_slack/actions) + +Slack integration with [Kino](https://github.com/livebook-dev/kino) +for [Livebook](https://github.com/livebook-dev/livebook). ## Installation -If [available in Hex](https://hex.pm/docs/publish), the package can be installed -by adding `kino_slack` to your list of dependencies in `mix.exs`: +To bring KinoSlack to Livebook all you need to do is `Mix.install/2`: ```elixir -def deps do - [ - {:kino_slack, "~> 0.1.0"} - ] -end +Mix.install([ + {:kino_slack, "~> 0.1.0"} +]) ``` -Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) -and published on [HexDocs](https://hexdocs.pm). Once published, the docs can -be found at . +## License + +Copyright (C) 2022 Dashbit + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/guides/components.livemd b/guides/components.livemd new file mode 100644 index 0000000..0da1766 --- /dev/null +++ b/guides/components.livemd @@ -0,0 +1,14 @@ +# Components + +```elixir +Mix.install([ + {:kino_slack, "~> 0.1.0"}, + {:req, "~> 0.3.0"} +]) +``` + +## Smart cells + +The following Smart cells are available: + +* **Slack message** - for sending a message to a Slack channel diff --git a/lib/assets/main.css b/lib/assets/main.css index 9bf8228..b9ef16c 100644 --- a/lib/assets/main.css +++ b/lib/assets/main.css @@ -12,10 +12,11 @@ --gray-600: #445668; --gray-700: #304254; --gray-800: #1c2a3a; + --gray-900: #0d1829; --blue-100: #ecf0ff; - --red--300: #F1A3A6; + --red--300: #f1a3a6; } input, @@ -44,7 +45,6 @@ button { justify-content: flex-start; background-color: var(--blue-100); padding: 8px 16px; - margin-bottom: 12px; border-radius: 0.5rem 0.5rem 0 0; border-bottom: solid 1px var(--gray-200); gap: 16px; @@ -188,5 +188,17 @@ a.icon-button { font-size: 1.125em; } +.help-box a { + color: var(--gray-900); + font-weight: 500; + text-decoration: underline; +} + +.help-box a:hover { + text-decoration: none; +} + /* For not showing hidden elements before AlpineJS loads */ -[x-cloak] { display: none !important; } +[x-cloak] { + display: none !important; +} diff --git a/mix.exs b/mix.exs index 8ce0c6c..c615859 100644 --- a/mix.exs +++ b/mix.exs @@ -1,29 +1,50 @@ defmodule KinoSlack.MixProject do use Mix.Project + @version "0.1.0" + @description "Slack integration with Livebook" + def project do [ app: :kino_slack, - version: "0.1.0", + version: @version, + description: @description, + name: "KinoSlack", elixir: "~> 1.14", start_permanent: Mix.env() == :prod, - deps: deps() + deps: deps(), + docs: docs(), + package: package() ] end - # Run "mix help compile.app" to learn about applications. def application do - [ - extra_applications: [:logger], - mod: {KinoSlack.Application, []} - ] + [mod: {KinoSlack.Application, []}] end - # Run "mix help deps" to learn about dependencies. defp deps do [ {:kino, "~> 0.7"}, - {:req, "~> 0.3"} + {:req, "~> 0.3"}, + {:ex_doc, "~> 0.29", only: :dev, runtime: false} + ] + end + + defp docs do + [ + main: "components", + source_url: "https://github.com/livebook-dev/kino_slack", + source_ref: "v#{@version}", + extras: ["guides/components.livemd"] + ] + end + + def package do + [ + licenses: ["Apache-2.0"], + links: %{ + "GitHub" => "https://github.com/livebook-dev/kino_slack" + } ] end end diff --git a/mix.lock b/mix.lock index 937ba3e..2d104bc 100644 --- a/mix.lock +++ b/mix.lock @@ -1,12 +1,18 @@ %{ "castore": {:hex, :castore, "0.1.19", "a2c3e46d62b7f3aa2e6f88541c21d7400381e53704394462b9fd4f06f6d42bb6", [:mix], [], "hexpm", "e96e0161a5dc82ef441da24d5fa74aefc40d920f3a6645d15e1f9f3e66bb2109"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.29", "149d50dcb3a93d9f3d6f3ecf18c918fb5a2d3c001b5d3305c926cddfbd33355b", [:mix], [], "hexpm", "4902af1b3eb139016aed210888748db8070b8125c2342ce3dcae4f38dcc63503"}, + "ex_doc": {:hex, :ex_doc, "0.29.1", "b1c652fa5f92ee9cf15c75271168027f92039b3877094290a75abcaac82a9f77", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "b7745fa6374a36daf484e2a2012274950e084815b936b1319aeebcf7809574f6"}, "finch": {:hex, :finch, "0.13.0", "c881e5460ec563bf02d4f4584079e62201db676ed4c0ef3e59189331c4eddf7b", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: false]}, {:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.3", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.2.6", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "49957dcde10dcdc042a123a507a9c5ec5a803f53646d451db2f7dea696fba6cc"}, "hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"}, "jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"}, "kino": {:hex, :kino, "0.8.0", "07603a32c111959ed48f08ac3808a0dda05433d28f8d2f06d65b25b255966649", [:mix], [{:nx, "~> 0.1", [hex: :nx, repo: "hexpm", optional: true]}, {:table, "~> 0.1.2", [hex: :table, repo: "hexpm", optional: false]}], "hexpm", "736568d4de9eb56d8903bae6fe08b7c06db44efe37bb883165e755e623881c51"}, + "makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"}, + "makeup_elixir": {:hex, :makeup_elixir, "0.16.0", "f8c570a0d33f8039513fbccaf7108c5d750f47d8defd44088371191b76492b0b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "28b2cbdc13960a46ae9a8858c4bebdec3c9a6d7b4b9e7f4ed1502f8159f338e7"}, + "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, "mime": {:hex, :mime, "2.0.3", "3676436d3d1f7b81b5a2d2bd8405f412c677558c81b1c92be58c00562bb59095", [:mix], [], "hexpm", "27a30bf0db44d25eecba73755acf4068cbfe26a4372f9eb3e4ea3a45956bff6b"}, "mint": {:hex, :mint, "1.4.2", "50330223429a6e1260b2ca5415f69b0ab086141bc76dc2fbf34d7c389a6675b2", [:mix], [{:castore, "~> 0.1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "ce75a5bbcc59b4d7d8d70f8b2fc284b1751ffb35c7b6a6302b5192f8ab4ddd80"}, "nimble_options": {:hex, :nimble_options, "0.4.0", "c89babbab52221a24b8d1ff9e7d838be70f0d871be823165c94dd3418eea728f", [:mix], [], "hexpm", "e6701c1af326a11eea9634a3b1c62b475339ace9456c1a23ec3bc9a847bca02d"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"}, "nimble_pool": {:hex, :nimble_pool, "0.2.6", "91f2f4c357da4c4a0a548286c84a3a28004f68f05609b4534526871a22053cde", [:mix], [], "hexpm", "1c715055095d3f2705c4e236c18b618420a35490da94149ff8b580a2144f653f"}, "req": {:hex, :req, "0.3.2", "58b87ecd1b787b8ea3355444665787ef0cabe24bb3ab57c6adb5e67a9ff08ded", [:mix], [{:brotli, "~> 0.3.1", [hex: :brotli, repo: "hexpm", optional: true]}, {:ezstd, "~> 1.0", [hex: :ezstd, repo: "hexpm", optional: true]}, {:finch, "~> 0.9", [hex: :finch, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:nimble_csv, "~> 1.0", [hex: :nimble_csv, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "1b320391fae9b52c5c56587d091c9e27ce1b93259d592436bfcddfa3ceef0de1"}, "table": {:hex, :table, "0.1.2", "87ad1125f5b70c5dea0307aa633194083eb5182ec537efc94e96af08937e14a8", [:mix], [], "hexpm", "7e99bc7efef806315c7e65640724bf165c3061cdc5d854060f74468367065029"},