From 278db201f60038ed5aba56699ec52379df862b1d Mon Sep 17 00:00:00 2001
From: Pamela Wochner
Date: Fri, 4 Oct 2024 10:26:05 +0200
Subject: [PATCH 1/2] Automatically build md from Pluto notebooks using
PlutoStaticHTML. Delete obsolete html files.
---
docs/make.jl | 41 +++++++++----------
docs/src/tutorials/abstract_syntax_trees.html | 18 --------
docs/src/tutorials/advanced_search.html | 17 --------
docs/src/tutorials/advanced_search.jl | 3 ++
docs/src/tutorials/defining_grammars.html | 17 --------
.../getting_started_with_constraints.html | 17 --------
.../tutorials/getting_started_with_herb.html | 17 --------
.../tutorials/working_with_interpreters.html | 17 --------
8 files changed, 22 insertions(+), 125 deletions(-)
delete mode 100644 docs/src/tutorials/abstract_syntax_trees.html
delete mode 100644 docs/src/tutorials/advanced_search.html
delete mode 100644 docs/src/tutorials/defining_grammars.html
delete mode 100644 docs/src/tutorials/getting_started_with_constraints.html
delete mode 100644 docs/src/tutorials/getting_started_with_herb.html
delete mode 100644 docs/src/tutorials/working_with_interpreters.html
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 @@
-
-
-