diff --git a/docs/make.jl b/docs/make.jl index 402bc80..ffc36e5 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,6 +1,10 @@ -using Documenter +using Documenter: + HTML, + deploydocs, + makedocs -using Pluto, PlutoSliderServer +using PlutoStaticHTML +using Pkg: Pkg using Herb @@ -11,27 +15,20 @@ using HerbInterpret using HerbCore using HerbSpecification -# Create md file for tutorial that embeds html file -basedir = joinpath(@__DIR__, "src", "tutorials") -html_files = filter!(f -> occursin(r"\.html$", f), readdir(basedir)) # assumes all html file in directory are tutorials +tutorials_dir = joinpath(dirname(@__DIR__), "docs", "src", "tutorials") -for f in html_files - html_path = joinpath(basedir, f) - filename = replace(f, ".html" => "") - md_path = joinpath(basedir, "$filename.md") - content = """ - # Tutorial $filename - - - """ - open(md_path, "w") do file - write( - file, - content - ) - end +function build() + println("Building notebooks in $tutorials_dir") + use_distributed = false + output_format = documenter_output + bopts = BuildOptions(tutorials_dir; use_distributed, output_format) + build_notebooks(bopts) + Pkg.activate(@__DIR__) + return nothing end +build() + makedocs( modules=[HerbConstraints, HerbSearch, HerbGrammar, HerbSpecification, HerbInterpret, HerbCore], @@ -62,9 +59,9 @@ makedocs( "HerbSearch.jl" => "HerbSearch/index.md", ], ], - format=Documenter.HTML( + format=HTML( sidebar_sitename=false, - size_threshold=512000, + size_threshold=2^20, ), warnonly=[:missing_docs, :cross_references, :doctest] ) diff --git a/docs/src/tutorials/abstract_syntax_trees.html b/docs/src/tutorials/abstract_syntax_trees.html deleted file mode 100644 index f002fb3..0000000 --- a/docs/src/tutorials/abstract_syntax_trees.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - -
\ No newline at end of file diff --git a/docs/src/tutorials/advanced_search.html b/docs/src/tutorials/advanced_search.html deleted file mode 100644 index c43adcc..0000000 --- a/docs/src/tutorials/advanced_search.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - -
\ No newline at end of file diff --git a/docs/src/tutorials/advanced_search.jl b/docs/src/tutorials/advanced_search.jl index ba70384..0f829f6 100644 --- a/docs/src/tutorials/advanced_search.jl +++ b/docs/src/tutorials/advanced_search.jl @@ -11,6 +11,9 @@ using PlutoUI using HerbGrammar, HerbSpecification, HerbSearch, HerbInterpret, HerbConstraints, HerbCore +# ╔═╡ e0b2bfe8-bad3-47a3-803f-04b4a9deb232 +using Test + # ╔═╡ dddca175-3d88-45ce-90da-575c0ba38175 md""" # Advanced Search Procedures in Herb.jl @@ -139,7 +142,7 @@ problem_2 = Problem([IOExample(Dict(), x) for x ∈ 1:5]) iterator_3 = BFSIterator(g_2, :Index, max_depth=2) # ╔═╡ 4821fd3a-ff2d-4991-99ad-76608d11b1da -solution_3 = synth(problem_2, iterator_3) +Test.@test_throws HerbSearch.EvaluationError synth(problem_2, iterator_3) # ╔═╡ b2eb08d7-3e53-46c5-84b1-e1fa0e07e291 md""" @@ -470,6 +473,7 @@ HerbInterpret = "5bbddadd-02c5-4713-84b8-97364418cca7" HerbSearch = "3008d8e8-f9aa-438a-92ed-26e9c7b4829f" HerbSpecification = "6d54aada-062f-46d8-85cf-a1ceaf058a06" PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] HerbConstraints = "~0.2.2" @@ -487,7 +491,7 @@ PLUTO_MANIFEST_TOML_CONTENTS = """ julia_version = "1.10.4" manifest_format = "2.0" -project_hash = "e8df13c29bfd5a0060b6c72e678efa3df418b0d7" +project_hash = "0ffb99b60bda019fda3cc31f30ebdb78c9cca62d" [[deps.AbstractPlutoDingetjes]] deps = ["Pkg"] @@ -1235,6 +1239,7 @@ version = "0.13.1+0" # ╠═9fb40ceb-8d41-491b-8941-20a8b240eb82 # ╠═94e0d676-a9c7-4291-8696-15301e541c30 # ╠═a4a7daed-f89b-44ad-8787-9199c05bf046 +# ╠═e0b2bfe8-bad3-47a3-803f-04b4a9deb232 # ╠═4821fd3a-ff2d-4991-99ad-76608d11b1da # ╟─b2eb08d7-3e53-46c5-84b1-e1fa0e07e291 # ╠═606070e1-83a7-4cca-a716-4fa459f78772 diff --git a/docs/src/tutorials/defining_grammars.html b/docs/src/tutorials/defining_grammars.html deleted file mode 100644 index 63bbd5c..0000000 --- a/docs/src/tutorials/defining_grammars.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - -
\ No newline at end of file diff --git a/docs/src/tutorials/getting_started_with_constraints.html b/docs/src/tutorials/getting_started_with_constraints.html deleted file mode 100644 index 67e1c71..0000000 --- a/docs/src/tutorials/getting_started_with_constraints.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - -
\ No newline at end of file diff --git a/docs/src/tutorials/getting_started_with_herb.html b/docs/src/tutorials/getting_started_with_herb.html deleted file mode 100644 index c21184d..0000000 --- a/docs/src/tutorials/getting_started_with_herb.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - -
\ No newline at end of file diff --git a/docs/src/tutorials/working_with_interpreters.html b/docs/src/tutorials/working_with_interpreters.html deleted file mode 100644 index f9ae880..0000000 --- a/docs/src/tutorials/working_with_interpreters.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - -
\ No newline at end of file