Skip to content

Commit 34f9207

Browse files
committed
docs: hide livebook run-badge, document downloads in the README
ex_doc renders a "Run in Livebook" badge on every .livemd extra with no way to suppress or platform-gate it, and its livebook.dev/run target fails to open on the hosted (Linux) Livebooks most visitors reach — where Emily's macOS / Apple-Silicon NIF can't load anyway. Hide the badge with a before_closing_head_tag CSS rule (`!important`, to beat ex_doc's more specific `.content-inner` selector), and add a note to the README's Livebooks section covering the Apple Silicon requirement and how to view/download each notebook via its page's "View Source" link — rather than repeating an admonition in all eight livebooks.
1 parent b22a43c commit 34f9207

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,13 @@ End-to-end Livebooks under `livebooks/`. Each one declares its own
320320
`Mix.install/2` block and pins `Emily.Backend` as the default Nx
321321
backend, so they're self-contained — open in Livebook and run.
322322

323+
> **Requires Apple Silicon + macOS 14+** (MLX / Metal) — these
324+
> notebooks won't run on Linux or Intel hosts, including the hosted
325+
> Livebooks a "Run in Livebook" badge would open. To get a copy, open
326+
> its page in the Livebooks section of these docs and use the **View
327+
> Source** link (top-right) to view or download the `.livemd` from
328+
> GitHub, then run it in Livebook on a Mac.
329+
323330
- **`distilbert_qa.livemd`** — question answering with
324331
`distilbert-base-uncased-distilled-squad`.
325332
- **`qwen3_quantized.livemd`** — Qwen3-0.6B int4-quantized via the

mix.exs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ defmodule Emily.MixProject do
208208
[
209209
main: "readme",
210210
source_url_pattern: "#{@source_url}/blob/#{@version}/%{path}#L%{line}",
211+
before_closing_head_tag: &before_closing_head_tag/1,
211212
# Symbols ExDoc can't link, so it warns on every reference to them.
212213
# Listed explicitly on purpose: the `mix precommit` docs gate fails
213214
# with the exact unlinkable symbol when a new one appears, making each
@@ -266,6 +267,18 @@ defmodule Emily.MixProject do
266267
]
267268
end
268269

270+
# ex_doc renders a "Run in Livebook" badge on every `.livemd` extra
271+
# (extra_template.eex) with no option to suppress it. Emily's NIF is
272+
# macOS / Apple-Silicon only, and the badge's `livebook.dev/run` target
273+
# fails to open on the hosted (Linux) Livebooks most visitors reach, so
274+
# we hide it — each livebook links to its GitHub source/download instead.
275+
# `!important` is required to beat ex_doc's more specific
276+
# `.content-inner .livebook-badge-container { display: flex }` rule.
277+
defp before_closing_head_tag(:html),
278+
do: ~s(<style>.livebook-badge-container{display:none!important}</style>)
279+
280+
defp before_closing_head_tag(_), do: ""
281+
269282
defp package do
270283
[
271284
licenses: ["MIT"],

0 commit comments

Comments
 (0)