Skip to content

Commit

Permalink
add PrintToScript constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
disberd committed Oct 8, 2023
1 parent eb94987 commit 0e03802
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/combine_htl/constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ PrintToScript(@nospecialize(t); display_type = displaylocation(t)) = PrintToScri
PrintToScript(@nospecialize(t::PrintToScript); display_type = displaylocation(t)) = PrintToScript(t.el, displaylocation(display_type))
PrintToScript(@nospecialize(t::AbstractHTML); kwargs...) = error("You can't wrap object of type $(typeof(t)) with PrintToScript")
PrintToScript(@nospecialize(t::Union{SingleScript, DualScript}); display_type = displaylocation(t)) = PrintToScript(t, displaylocation(display_type))
PrintToScript(x::Union{AbstractString, ScriptContent, Result}; kwargs...) = PrintToScript(DualScript(ScriptContent(x)); kwargs...)

# DualNode #
DualNode(i, o) = DualNode(PlutoNode(i), NormalNode(o))
Expand Down
3 changes: 3 additions & 0 deletions test/combinehtl_module.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ using PlutoDevMacros.PlutoCombineHTL.AbstractPlutoDingetjes.Display

@test PrintToScript(pts) === pts
@test_throws "You can't wrap" PrintToScript(PlutoNode("asd"))

pts = PrintToScript("asd")
@test pts.el isa DualScript
end

@testset "make_node" begin
Expand Down

2 comments on commit 0e03802

@disberd
Copy link
Owner Author

@disberd disberd commented on 0e03802 Oct 8, 2023

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@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/93016

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.6.0 -m "<description of version>" 0e03802b473c1c88336167e3327dbd38df9dbe89
git push origin v0.6.0

Please sign in to comment.