Skip to content

Commit

Permalink
Merge pull request #42 from gdalle/gd/split_twocolumn
Browse files Browse the repository at this point in the history
Add inter-column spacing in `TwoColumn` and `ThreeColumn`
  • Loading branch information
eford authored Apr 24, 2024
2 parents 4240645 + 9e9f52c commit 2733205
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PlutoTeachingTools"
uuid = "661c6b06-c737-4d37-b85c-46df65de6f69"
authors = ["Eric Ford <[email protected]> and contributors"]
version = "0.2.14"
version = "0.2.15"

[deps]
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
Expand Down
25 changes: 14 additions & 11 deletions src/present.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ struct TwoColumn{L, R}
end

function Base.show(io, mime::MIME"text/html", tc::TwoColumn)
write(io, """<div style="display: flex;"><div style="flex: 50%;">""")
write(io, """<div style="display: flex;"><div style="flex: 49%;">""")
show(io, mime, tc.left)
write(io, """</div><div style="flex: 50%;">""")
write(io, """</div><div style="flex: 2%;">""")
write(io, """</div><div style="flex: 49%;">""")
show(io, mime, tc.right)
write(io, """</div></div>""")
end
Expand All @@ -43,9 +44,10 @@ struct TwoColumnWideLeft{L, R}
end

function Base.show(io, mime::MIME"text/html", tc::TwoColumnWideLeft)
write(io, """<div style="display: flex;"><div style="flex: 66%;">""")
write(io, """<div style="display: flex;"><div style="flex: 65%;">""")
show(io, mime, tc.left)
write(io, """</div><div style="flex: 34%;">""")
write(io, """</div><div style="flex: 2%;">""")
write(io, """</div><div style="flex: 33%;">""")
show(io, mime, tc.right)
write(io, """</div></div>""")
end
Expand All @@ -56,9 +58,10 @@ struct TwoColumnWideRight{L, R}
end

function Base.show(io, mime::MIME"text/html", tc::TwoColumnWideRight)
write(io, """<div style="display: flex;"><div style="flex: 34%;">""")
write(io, """<div style="display: flex;"><div style="flex: 33%;">""")
show(io, mime, tc.left)
write(io, """</div><div style="flex: 66%;">""")
write(io, """</div><div style="flex: 2%;">""")
write(io, """</div><div style="flex: 65%;">""")
show(io, mime, tc.right)
write(io, """</div></div>""")
end
Expand All @@ -70,11 +73,13 @@ struct ThreeColumn{L, C, R}
end

function Base.show(io, mime::MIME"text/html", tc::ThreeColumn)
write(io, """<div style="display: flex;"><div style="flex: 33%;">""")
write(io, """<div style="display: flex;"><div style="flex: 32%;">""")
show(io, mime, tc.left)
write(io, """</div><div style="flex: 34%;">""")
write(io, """</div><div style="flex: 2%;">""")
write(io, """</div><div style="flex: 32%;">""")
show(io, mime, tc.center)
write(io, """</div><div style="flex: 33%;">""")
write(io, """</div><div style="flex: 2%;">""")
write(io, """</div><div style="flex: 32%;">""")
show(io, mime, tc.right)
write(io, """</div></div>""")
end
Expand Down Expand Up @@ -131,5 +136,3 @@ function ChooseDisplayMode(;wide::Bool=false, present::Bool = false, lang::Abstr
""")
end


2 comments on commit 2733205

@eford
Copy link
Collaborator Author

@eford eford commented on 2733205 Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

  • Improve spacing of multi-column
  • Fixed typeos

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/105555

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.15 -m "<description of version>" 2733205967edea02dacd1d0f671dd74e56d1d377
git push origin v0.2.15

Please sign in to comment.