diff --git a/docs/Project.toml b/docs/Project.toml index 97cc417..fc3b6af 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,17 +1,11 @@ [deps] -CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" Luxor = "ae8d54c2-7ccd-5906-9d76-62fc9837b5bc" -MakieTeX = "6d554a22-29e7-47bd-aee5-0c5f06619414" -TypstJlyfish = "95e5b356-b122-4883-a78a-3c8c946b7332" Typstry = "f0ed7684-a786-439e-b1e3-3b82803b501e" [compat] -CairoMakie = "0.12.3" Documenter = "1" Luxor = "3 - 4" -MakieTeX = "0.4.2" -TypstJlyfish = "0.1.0" julia = "1.10" diff --git a/docs/source/guides/package_interoperability.md b/docs/source/guides/package_interoperability.md index 4e62b94..60a7ad4 100644 --- a/docs/source/guides/package_interoperability.md +++ b/docs/source/guides/package_interoperability.md @@ -18,24 +18,35 @@ whereas IJulia.jl will support them in its next feature release. `````@eval using Markdown: Markdown -module X -include("../scripts/include_makie_tex.jl") -const s = read("../../../scripts/makie_tex.jl", String) -end -Markdown.parse("```julia-repl$(join(map(s -> "\njulia> " * s, split(strip(X.s), "\n")), "\n"))\n```") -````` +Markdown.parse("""```julia-repl +julia> using CairoMakie, MakieTeX + +julia> f = Figure(; size = (100, 100)) -![MakieTeX.jl](makie_tex.svg) +julia> LTeX(f[1, 1], TypstDocument(typst"\$ 1 / x \$")) + +julia> save("makie_tex.svg", f) +```""") +````` ### TypstJlyfish.jl `````@eval -module X using Markdown: Markdown -include("../scripts/typst_jlyfish.jl") -const md = Markdown.parse("```typst\n$ts```\n```julia-repl\njulia> $_using\n\njulia> $compile\n```") -end -X.md +using Typstry: preamble +Markdown.parse("""```typst +$preamble#import "@preview/jlyfish:0.1.0": * +#read-julia-output(json("typst_jlyfish.json")) +#jl-pkg("Typstry") +#jl(`using Typstry; typst"\$1 / x\$"`) +``` + +```julia-repl +julia> using TypstJlyfish, Typstry + +julia> TypstJlyfish.compile("typst_jlyfish.typ"; + evaluation_file = "typst_jlyfish.json", + typst_compile_args = "--format=svg --font-path=\$julia_mono" + ) +```""") ````` - -![TypstJlyfish.jl](typst_jlyfish.svg) diff --git a/scripts/include_makie_tex.jl b/scripts/include_makie_tex.jl deleted file mode 100644 index 5c2091b..0000000 --- a/scripts/include_makie_tex.jl +++ /dev/null @@ -1,5 +0,0 @@ - -using Logging: Debug, Warn, disable_logging -disable_logging(Warn) -include("makie_tex.jl") -disable_logging(Debug) diff --git a/scripts/makie_tex.jl b/scripts/makie_tex.jl deleted file mode 100644 index 0353524..0000000 --- a/scripts/makie_tex.jl +++ /dev/null @@ -1,5 +0,0 @@ - -using CairoMakie, MakieTeX, Typstry -f = Figure(; size = (100, 100)) -LTeX(f[1, 1], TypstDocument(typst"\(preamble)$ 1 / x $"); scale = 2) -save("makie_tex.svg", f) diff --git a/scripts/typst_jlyfish.jl b/scripts/typst_jlyfish.jl deleted file mode 100644 index adbcba9..0000000 --- a/scripts/typst_jlyfish.jl +++ /dev/null @@ -1,18 +0,0 @@ - -using Typstry: @typst_str, julia_mono, preamble - -const ts = typst""" -\(preamble)#import "@preview/jlyfish:0.1.0": * -#read-julia-output(json("typst_jlyfish.json")) -#jl-pkg("Typstry") -#jl(`using Typstry; typst"$1 / x$"`) -""" - -const _using, compile = [ - "using TypstJlyfish, Typstry", - "TypstJlyfish.compile(\"typst_jlyfish.typ\";\n evaluation_file = \"typst_jlyfish.json\",\n typst_compile_args = \"--format=svg --font-path=\$julia_mono\"\n )" -] - -write("typst_jlyfish.typ", ts) -eval(Meta.parse(_using)) -redirect_stderr(() -> eval(Meta.parse(compile)), devnull) diff --git a/test/Project.toml b/test/Project.toml index 92dc9c0..046f634 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,23 +1,17 @@ [deps] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" -CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7" LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" -MakieTeX = "6d554a22-29e7-47bd-aee5-0c5f06619414" Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" -TypstJlyfish = "95e5b356-b122-4883-a78a-3c8c946b7332" Typstry = "f0ed7684-a786-439e-b1e3-3b82803b501e" [compat] -CairoMakie = "0.12.3" Documenter = "1" ExplicitImports = "1.6" -MakieTeX = "0.4.2" -TypstJlyfish = "0.1.0" julia = "1.10" [extras] diff --git a/test/interoperability/TestMakieTeX.jl b/test/interoperability/TestMakieTeX.jl deleted file mode 100644 index 336544e..0000000 --- a/test/interoperability/TestMakieTeX.jl +++ /dev/null @@ -1,8 +0,0 @@ - -module TestMakieTeX - using Test: @test - @test begin - include("../../scripts/include_makie_tex.jl") - true - end -end diff --git a/test/interoperability/TestTypstJlyfish.jl b/test/interoperability/TestTypstJlyfish.jl deleted file mode 100644 index 12a1e51..0000000 --- a/test/interoperability/TestTypstJlyfish.jl +++ /dev/null @@ -1,8 +0,0 @@ - -module TestTypstJlyfish - using Test: @test - @test begin - include("../../scripts/typst_jlyfish.jl") - true - end -end diff --git a/test/runtests.jl b/test/runtests.jl index d9763c1..0035fa9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -25,7 +25,6 @@ test_strings(x, s; kwargs...) = @test TypstString(x; kwargs...) == s "Utilities" => ["Aqua", "Documenter", "ExplicitImports"], "Interface" => ["Strings", "Commands"], "Extensions" => map(string, names), - "Interoperability" => ["MakieTeX", "TypstJlyfish"] ] @info "Testing $description" @testset "$description" begin