@@ -3,6 +3,7 @@ using GenericTensorNetworks
33using GenericTensorNetworks: TropicalNumbers, Polynomials, Mods, OMEinsum, OMEinsumContractionOrders
44using Documenter
55using DocThemeIndigo
6+ using PlutoStaticHTML
67using Literate
78
89for each in readdir (pkgdir (GenericTensorNetworks, " examples" ))
@@ -14,6 +15,22 @@ for each in readdir(pkgdir(GenericTensorNetworks, "examples"))
1415 Literate. markdown (input_file, output_dir; name= each[1 : end - 3 ], execute= false )
1516end
1617
18+ """ Run all Pluto notebooks (".jl" files) in `notebook_dir` and write outputs to HTML files."""
19+ function build ()
20+ notebook_dir = joinpath (pkgdir (GenericTensorNetworks), " notebooks" )
21+ target_dir = joinpath (pkgdir (GenericTensorNetworks), " docs" , " src" , " notebooks" )
22+ cp (notebook_dir, target_dir)
23+ println (" Building tutorials" )
24+ # Evaluate notebooks in the same process to avoid having to recompile from scratch each time.
25+ # This is similar to how Documenter and Franklin evaluate code.
26+ # Note that things like method overrides and other global changes may leak between notebooks!
27+ use_distributed = false
28+ output_format = documenter_output
29+ bopts = BuildOptions (target_dir; use_distributed, output_format)
30+ build_notebooks (bopts)
31+ return nothing
32+ end
33+
1734indigo = DocThemeIndigo. install (GenericTensorNetworks)
1835DocMeta. setdocmeta! (GenericTensorNetworks, :DocTestSetup , :(using GenericTensorNetworks); recursive= true )
1936
0 commit comments