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

use PlutoUI.details for Foldable #60

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/PlutoTeachingTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Downloads: download # used in robustlocalresouce.jl
using PlutoUI: Resource, LocalResource # used in robustlocalresouce.jl
using PlutoUI: combine # used in footnotes.jl
using PlutoUI: Select # used in i8n/i8n.jl
using PlutoUI: details # used in present.jl for Foldable
using Latexify: latexify # used in latex.jl

using PlutoLinks: @ingredients
Expand Down
11 changes: 1 addition & 10 deletions src/present.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,8 @@ function present_button(lang::AbstractLanguage=default_language[])
htl"<button onclick='present()'>$txt</button>"
end

struct Foldable{C}
title::String
content::C
end
Foldable(title, content) = details(title, content)

function Base.show(io, mime::MIME"text/html", fld::Foldable)
write(io, "<details><summary>$(fld.title)</summary><p>")
show(io, mime, fld.content)
write(io, "</p></details>")
return nothing
end

struct TwoColumn{L,R}
left::L
Expand Down
Loading