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

Embedding Kotlin Playgroundに対応する #45

Closed
ghost opened this issue Mar 11, 2022 · 2 comments
Closed

Embedding Kotlin Playgroundに対応する #45

ghost opened this issue Mar 11, 2022 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Mar 11, 2022

概要

Embedding Kotlin Playground
https://blog.jetbrains.com/kotlin/2018/04/embedding-kotlin-playground/#:~:text=Embedded%20Kotlin%20Playground%20works%20on,target%20is%20set%20to%20JVM

に従い、HTMLのヘッダーに以下1行を挿入する

<script src="https://unpkg.com/kotlin-playground@1" data-selector="code"></script>

すると、ページ内で実行環境が出来上がる

これを全ページに適用できれば、access-company/KotlinTrainingが不要になる

調査事項

GitbookでHTMLヘッダーを変えたい場合、どうすればよいか

https://github.com/NoriSte/gitbook-plugin-head-append
が使えるかな?

@ghost
Copy link
Author

ghost commented Mar 11, 2022

https://github.com/NoriSte/gitbook-plugin-head-append
が使えるかな?

973088f で使えることがわかった。

しかし、scriptヘッダーを入れるだけだと文中のcodeブロック全部に適用されてしまうので、例えば

のhelloみたいにビルド対象じゃない箇所にも適用されてしまう。

`〜`なら非適用で```〜```なら適用とか、Kotlinのコードだけに適用、みたいな区別をしたいところ。

@ghost
Copy link
Author

ghost commented Mar 14, 2022

```Kotlin〜``` で囲まれるコードにはlang-kotlinクラスが付くので、それをscriptタグに指定 08c8e72 すれば期待通りの仕上がりになった

ここはmainクラスがないので再生でけへんけど #49 で全体精査予定

@ghost ghost self-assigned this Mar 14, 2022
@ghost ghost added the 2022 label Mar 14, 2022
@ghost ghost changed the title Embedding Kotlin Playgroundに対応したい Embedding Kotlin Playgroundに対応suru Mar 14, 2022
@ghost ghost changed the title Embedding Kotlin Playgroundに対応suru Embedding Kotlin Playgroundに対応する Mar 14, 2022
@ghost ghost mentioned this issue Mar 16, 2022
@ghost ghost closed this as completed Mar 17, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants