$data
", id)
+}
+```
+
+![](/demo/comm-receive.gif)
+
+TODO Send to client
+
### Display data
The `publish` field, of type [`almond.interpreter.api.OutputHandler`](https://github.com/almond-sh/almond/blob/master/modules/shared/interpreter-api/src/main/scala/almond/interpreter/api/OutputHandler.scala), has numerous methods to push display data to the front-end.
@@ -74,27 +153,3 @@ kernel.publish.updateHtml("Got all items", id)
```
![](/demo/updatable.gif)
-
-### Comm messages
-
-[Comm messages](https://jupyter-notebook.readthedocs.io/en/5.7.2/comms.html) are part of the
-[Jupyter messaging protocol](https://jupyter-client.readthedocs.io/en/5.2.3/messaging.html). They
-allow the exchange of arbitrary messages between code running in the front-end (typically JavaScript code)
-and kernels.
-
-The comm API can be used to receive messages, or send them.
-
-`kernel.comm.receiver` allows to register a target to receive messages from the front-end, like
-```scala
-val id = java.util.UUID.randomUUID().toString
-kernel.publish.html("Waiting", id)
-
-kernel.comm.receiver("A") { data =>
- // received message `data` from front-end
- kernel.publish.updateHtml(s"$data
", id)
-}
-```
-
-![](/demo/comm-receive.gif)
-
-TODO Send to client
diff --git a/docs/website/sidebars.json b/docs/website/sidebars.json
index 4419dd2e4..c1c1fad83 100644
--- a/docs/website/sidebars.json
+++ b/docs/website/sidebars.json
@@ -4,7 +4,7 @@
"Try it": ["try-mybinder", "try-docker"],
"Installation": ["quick-start-install", "install-options", "install-multiple", "install-versions", "install-other"],
"Usage": ["usage-plotting", "usage-spark"],
- "User API": ["api", "api-access-instances", "api-ammonite", "api-jupyter"],
+ "User API": ["api", "api-ammonite", "api-jupyter", "api-access-instances"],
"Development": ["dev-from-sources", "dev-custom-kernel", "dev-libraries", "dev-website"]
}
}
diff --git a/examples/displays.ipynb b/examples/displays.ipynb
new file mode 100644
index 000000000..0415fe021
--- /dev/null
+++ b/examples/displays.ipynb
@@ -0,0 +1,164 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "\u001b[32mimport \u001b[39m\u001b[36malmond.display._\u001b[39m"
+ ]
+ },
+ "execution_count": 1,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "import almond.display._"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "hello"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "Html(\"hello\")"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "${baos.toString("UTF-8")}+ |
""" + } + private def suffix = { + val extra = + if (fadeIn0) "