Skip to content

Instantly share code, notes, and snippets.

@damourChris
Created February 15, 2024 01:40
Show Gist options
  • Save damourChris/ae0de69d44f1ea960c33a92599bd4d3d to your computer and use it in GitHub Desktop.
Save damourChris/ae0de69d44f1ea960c33a92599bd4d3d to your computer and use it in GitHub Desktop.
Cell Ordering Fails when a method that use @htl macro has a docstring attached to it
### A Pluto.jl notebook ###
# v0.19.38
using Markdown
using InteractiveUtils
# ╔═╡ 64275e96-9cb3-4139-abc6-868c73e0484d
using HypertextLiteral:@htl
# ╔═╡ fa438513-52ed-4b6a-b6fe-0f2ff86f0996
bad_function_no_return()
# ╔═╡ 0aba6218-c43e-4b21-8261-12cddcf0f46f
bad_function_return_htl()
# ╔═╡ ca50d500-bc62-4745-9892-a1b644f44cc8
md"---"
# ╔═╡ a360bf75-3079-499b-9cc6-219871868d7c
"""
bad_function_no_return()
I am bad function with docs strings using @htl
"""
function bad_function_no_return()
@htl("""I am bad function with docs strings, using @htl and return nothing""")
@info "I am bad function with docs strings and using @htl"
return
end
# ╔═╡ a0ebd0e6-2d9e-45e1-97db-e068a6336d63
"""
bad_function_return_htl()
I am bad function with docs strings using @htl
"""
function bad_function_return_htl()
@info "I am bad function with docs strings using @htl and return HTML"
@htl("""I am bad function with docs strings and using @htl""")
end
# ╔═╡ f9c2cd60-8708-4023-80f8-b2e2c54e3df2
function good_function()
@info "I am a nice function that does nothing"
end
# ╔═╡ 3876df39-73f0-44a1-bfd1-267206b04657
good_function()
# ╔═╡ 7c0d8925-3336-4f86-be18-8aa65d0ad96f
"""
good_function()
I am a nice function with docstrings
"""
function good_function_docs()
@info "I am a nice function with no docstrings"
end
# ╔═╡ c9ad6ec9-a30b-43c9-ae32-ff452abcc528
good_function_docs()
# ╔═╡ 6febe627-043e-4966-b8ac-1ecdf9a07aaa
function good_function_htl()
@info "I am a good function using @htl"
@htl("""I am a good function using @htl""")
end
# ╔═╡ 2ceb345c-becc-49d5-b358-dbd29da5a087
good_function_htl()
# ╔═╡ b0c0b11f-40f4-4167-894d-5620c6475563
md"---"
# ╔═╡ 22c07d0f-4dc6-4312-ab9a-babf067a9d54
good_function()
# ╔═╡ f0cfa37a-55fc-4632-b937-7138a9bba33c
good_function_docs()
# ╔═╡ 315eca19-bf0b-4907-afc0-cab76fbc9c7a
good_function_htl()
# ╔═╡ 3205ee79-9296-4e90-b7e5-1ade04f2ee3b
bad_function_return_htl()
# ╔═╡ 92199763-e573-4b64-b8a5-ad03e0981678
bad_function_no_return()
# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
[deps]
HypertextLiteral = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2"
[compat]
HypertextLiteral = "~0.9.5"
"""
# ╔═╡ 00000000-0000-0000-0000-000000000002
PLUTO_MANIFEST_TOML_CONTENTS = """
# This file is machine-generated - editing it directly is not advised
[[HypertextLiteral]]
deps = ["Tricks"]
git-tree-sha1 = "7134810b1afce04bbc1045ca1985fbe81ce17653"
uuid = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2"
version = "0.9.5"
[[Tricks]]
git-tree-sha1 = "eae1bb484cd63b36999ee58be2de6c178105112f"
uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775"
version = "0.1.8"
"""
# ╔═╡ Cell order:
# ╠═64275e96-9cb3-4139-abc6-868c73e0484d
# ╠═3876df39-73f0-44a1-bfd1-267206b04657
# ╠═c9ad6ec9-a30b-43c9-ae32-ff452abcc528
# ╠═2ceb345c-becc-49d5-b358-dbd29da5a087
# ╠═fa438513-52ed-4b6a-b6fe-0f2ff86f0996
# ╠═0aba6218-c43e-4b21-8261-12cddcf0f46f
# ╟─ca50d500-bc62-4745-9892-a1b644f44cc8
# ╠═a360bf75-3079-499b-9cc6-219871868d7c
# ╠═a0ebd0e6-2d9e-45e1-97db-e068a6336d63
# ╠═f9c2cd60-8708-4023-80f8-b2e2c54e3df2
# ╠═7c0d8925-3336-4f86-be18-8aa65d0ad96f
# ╠═6febe627-043e-4966-b8ac-1ecdf9a07aaa
# ╟─b0c0b11f-40f4-4167-894d-5620c6475563
# ╠═22c07d0f-4dc6-4312-ab9a-babf067a9d54
# ╠═f0cfa37a-55fc-4632-b937-7138a9bba33c
# ╠═315eca19-bf0b-4907-afc0-cab76fbc9c7a
# ╠═3205ee79-9296-4e90-b7e5-1ade04f2ee3b
# ╠═92199763-e573-4b64-b8a5-ad03e0981678
# ╟─00000000-0000-0000-0000-000000000001
# ╟─00000000-0000-0000-0000-000000000002
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment