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

Add linting tests with Aqua, JET and ExplicitImports, fix bugs #48

Merged
merged 19 commits into from
Sep 18, 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
11 changes: 2 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,16 @@ version = "0.2.15"
[deps]
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
HypertextLiteral = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
PlutoLinks = "0ff47ea0-7a50-410d-8455-4348d5de0420"
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[compat]
Downloads = "<0.0.1, 1"
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does v <0.0.1 mean? Why not just set this to "1"? Same for Markdown

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Markdown.jl and Downloads.jl are standard libraries and used to be coupled to their Julia releases. Now they are stand-alone packages and have version numbers. For backward compatibility, these new compat entries have to include <0.0.1. The 1 is the latest stable major release of Downloads.jl (currently 1.6.0).

You can find out more here: https://discourse.julialang.org/t/psa-compat-requirements-in-the-general-registry-are-changing/104958

HypertextLiteral = "0.9"
LaTeXStrings = "1"
Latexify = "0.15, 0.16"
Markdown = "<0.0.1, 1"
PlutoLinks = "0.1.5"
PlutoUI = "0.7"
julia = "1.6"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
22 changes: 18 additions & 4 deletions example.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ end
# ╔═╡ dee4aa68-e5eb-4a8a-869f-867e61de5ec5
using PlutoUI

# ╔═╡ 3f8dc975-b091-4dbe-bd48-c33236e61ece
using LaTeXStrings

# ╔═╡ cd581a51-fb2b-4579-9a7d-0d723ad5d467
md"# [PlutoTeachingTools.jl](https://github.com/JuliaPluto/PlutoTeachingTools.jl) Examples"

# ╔═╡ 84ccb960-41f8-430d-bd73-a7c0248cfb95
md"""
Language for common prompts: $(@bind lang Select(["en"=>"English","de"=>"German","es"=>"Spanish","ru"=>"Russian", "zh"=>"chinese"]))
Language for common prompts: $(@bind lang Select(["en"=>"English","de"=>"German","es"=>"Spanish","ru"=>"Russian", "zh"=>"Chinese"]))
"""

# ╔═╡ 657c3eea-1ef6-11ed-3e82-5daad2bc19a1
Expand Down Expand Up @@ -262,6 +265,12 @@ eqn_str = "x^2+y^2 = z^2"
# ╔═╡ 7390e4a7-0561-4611-b3c1-9b83601c5805
md"And you can grab equations in variables like $(wrap_tex(eqn_str)) inside markdown."

# ╔═╡ a9d9d87e-4cfe-4a34-bdb9-6bf3fc979bab
md"To simplify typing and displaying equations, we recommend using the [LaTeXStrings.jl](https://github.com/JuliaStrings/LaTeXStrings.jl) package:"

# ╔═╡ 0aefcfcd-ac8f-471b-8f90-7bb5235589ad
L"x^2+y^2 = z^2"

# ╔═╡ a05aa377-a201-4670-aae9-8de4059b67cb
md"#### Heading $nbsp $nbsp with extra space"

Expand Down Expand Up @@ -418,10 +427,12 @@ hello()
# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
[deps]
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
PlutoTeachingTools = "661c6b06-c737-4d37-b85c-46df65de6f69"
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"

[compat]
LaTeXStrings = "~1.3.1"
PlutoTeachingTools = "~0.2.12"
PlutoUI = "~0.7.52"
"""
Expand All @@ -432,7 +443,7 @@ PLUTO_MANIFEST_TOML_CONTENTS = """

julia_version = "1.10.5"
manifest_format = "2.0"
project_hash = "2af2aaef1ea67811bc114f2d0bf7f61179b912c7"
project_hash = "6a2354003a5c918e3f094011d689b03f8cd6a3fb"

[[deps.AbstractPlutoDingetjes]]
deps = ["Pkg"]
Expand Down Expand Up @@ -530,9 +541,9 @@ uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
version = "0.9.24"

[[deps.LaTeXStrings]]
git-tree-sha1 = "f2355693d6778a178ade15952b7ac47a4ff97996"
git-tree-sha1 = "50901ebc375ed41dbf8058da26f9de442febbbec"
uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
version = "1.3.0"
version = "1.3.1"

[[deps.Latexify]]
deps = ["Formatting", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "OrderedCollections", "Printf", "Requires"]
Expand Down Expand Up @@ -845,6 +856,9 @@ version = "17.4.0+2"
# ╠═af5673b5-a7f9-4033-ac9b-845254f62c98
# ╠═8fcfe710-ac2b-4282-85c6-d3b8800fa53a
# ╠═7390e4a7-0561-4611-b3c1-9b83601c5805
# ╟─a9d9d87e-4cfe-4a34-bdb9-6bf3fc979bab
# ╠═3f8dc975-b091-4dbe-bd48-c33236e61ece
# ╠═0aefcfcd-ac8f-471b-8f90-7bb5235589ad
# ╠═a05aa377-a201-4670-aae9-8de4059b67cb
# ╠═25066f0b-7100-431c-8695-70005738bbfd
# ╟─d7593309-3462-4dba-8275-c2eb76b4c3fe
Expand Down
62 changes: 50 additions & 12 deletions src/PlutoTeachingTools.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,57 @@
module PlutoTeachingTools

using PlutoUI
using HypertextLiteral # used by aside & present, might be useful elsewhere
using Markdown
using Markdown: @md_str, MD, Admonition, LaTeX
using HypertextLiteral: @htl, @htl_str
using Downloads: download # used in robustlocalresouce.jl
using PlutoUI: Resource, LocalResource # used in robustlocalresouce.jl
using PlutoUI: combine # used in footnotes.jl
using Latexify: latexify # used in latex.jl

using PlutoLinks: @ingredients # just for @ingredients
using PlutoLinks: @ingredients
export @ingredients

include("i18n/i18n.jl") # provides framework for multiple language support
include("computational_thinking.jl") # provides common note boxes
include("present.jl") # provides present_button() & ChooseDisplayMode()
include("latex.jl") # provides latexify_md and wrap_tex
include("aside.jl") # provides aside
include("robustlocalresource.jl") # provides RobustLocalResource
include("other.jl") # provides WidthOverDocs()
include("footnotes.jl") # provides FootnotesNumbered() and FootnotesInlineStyleSuperscript()
include("i18n/i18n.jl") # framework for multiple language support
export AbstractLanguage, set_language!
export preferred_text

include("computational_thinking.jl")
export hint, tip, protip, almost, warning_box, question_box, answer_box, danger, keyconcept
export correct, still_missing, still_nothing, wrong_type
export var_not_defined, func_not_defined, keep_working
export not_defined # deprecated
#export keep_working_if_var_contains_substr
export type_isa, type_eq
export code_for_check_type_funcs
export TODO, nbsp
export blockquote
export display_msg_if_fail

include("present.jl")
export present_button
export Foldable
export TwoColumn, ThreeColumn
export TwoColumnWideLeft, TwoColumnWideRight
export ChooseDisplayMode # combines present_button and WidthOverDocs

include("latex.jl")
export latexify_md, wrap_tex

include("aside.jl")
export aside, set_aside_width

include("robustlocalresource.jl")
export RobustLocalResource

include("other.jl")
export WidthOverDocs
export confetti

include("footnotes.jl")
export FootnotesInlineNumbered
export FootnotesBottomNumbered
export FootnotesNumbered
export FootnotesInlineStyleSuperscript
export FootnotesInlineStyleSubscript
export FootnotesInlineStyleBaseline

end # module
3 changes: 0 additions & 3 deletions src/aside.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using HypertextLiteral

export aside, set_aside_width

aside_has_been_setup = false
get_aside_has_been_setup()::Bool = aside_has_been_setup
Expand Down
Loading
Loading