Skip to content

Commit

Permalink
use PlutoUI.details for Foldable (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
greimel authored Oct 4, 2024
1 parent 316af4e commit 562dd11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
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

0 comments on commit 562dd11

Please sign in to comment.