-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add :caption and :download options to Kino.Mermaid #477
Add :caption and :download options to Kino.Mermaid #477
Conversation
8887c00
to
3f6b667
Compare
6bd623d
to
02b127b
Compare
02b127b
to
eeab847
Compare
9835491
to
fc41794
Compare
fc41794
to
4eb23ce
Compare
…in svg renderers like Chrome's)
c4a4794
to
6637652
Compare
c0d3da7
to
3fbc8d1
Compare
Note: I did not check in all the changes to the bundled mermaid assets, as there is a lot of churn there. Is that handled in the package publication process, or should I push the changes to |
@christhekeele thanks for the PR! I updated the styling and simplified some of the options :) |
Co-authored-by: Jonatan Kłosko <[email protected]>
Bundling in the PR is fine, I bundle before or after merging anyway :) (we want to keep git in sync, in case someone installs the package from GitHub; they may even install the PR branch to try it out) |
I did notice a couple of possible UI regressions with the updated styling, @jonatanklosko , thought I'd report them here. Large diagrams now get very small—unsure if this is intentional? (Partially mitigated by the full diagram being downloadable, now). For example, the {_, diagram} = Kino.Process.seq_trace(fn ->
{:ok, agent_pid} = Agent.start_link(fn -> [] end)
Process.monitor(agent_pid)
1..2
|> Task.async_stream(
fn value ->
Agent.get(agent_pid, fn value -> value end)
100 * value
end,
max_concurrency: 3
)
|> Stream.run()
Agent.stop(agent_pid)
end)
diagram with new styling it renders illegibly for me, like: whereas in the current release of Kino, and previous styling in this PR, it renders full-width: Additionally, vanilla unstyled diagrams have gotten... chonkier? post-update. most curious. New: old: Unsure if these are undesirable or not, just thought I'd mention them! OSX, recent Chrome |
@christhekeele thanks, the diagram width shrinking is unexpected, I've just fixed on main. The second is an expected change in mermaid v11, which I updated on main after this PR :) |
Originating from this thread on the forums, this PR:
Kino.Mermaid
diagrams an optional on-hover download button<figure>
<figcaption>
to describe the rendered diagramImages
Flexbox-centered
<figure>
(chrome browser defaults stylesheets adds a1em
margin to them)Figure with caption (styled roughly after Livebook's
.info-box
CSS)Flexbox-centering in a grid
Download button with title
Download with custom filename
Default captions for
Kino.Process.app_tree
exampleDefault captions for named
Kino.Process.sup_tree
exampleDefault captions for pid
Kino.Process.sup_tree
exampleDefault captions for
Kino.Process.seq_trace
example