0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

wslでelixir その165

Posted at

概要

wsl(wsl2じゃない)で、elixirやってみた。
練習問題やってみた。

練習問題

Livebookの、kino.jsで、youtubeを動作させよ。

写真

image.png

サンプルコード

defmodule KinoHTML.Youtube do
	use Kino.JS
	def new(url) do
		Kino.JS.new(__MODULE__, url)
	end
	asset "main.js" do
		"""
		export function init(ctx, url) {
			const iframe = document.createElement("iframe");
			iframe.setAttribute("src", url);
			iframe.style.width = "100%";
			iframe.style.height = "500px";
			iframe.style.border = "0";
			ctx.root.appendChild(iframe);
		}
		"""
	end
end

KinoHTML.Youtube.new("https://www.youtube.com/embed/7MWJ83iIx4g")

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?