Skip to content

Commit 11e72dc

Browse files
committed
update docs
1 parent 8ef8bab commit 11e72dc

File tree

4 files changed

+898
-6
lines changed

4 files changed

+898
-6
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ _test.bin
55
_test.txt
66
docs/build/
77
docs/src/tutorials/
8-
docs/src/assets/indigo.css
8+
docs/src/assets/indigo.css
9+
docs/src/notebooks

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ GenericTensorNetworks = "3521c873-ad32-4bb4-b63d-f4f178f42b49"
55
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
66
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
77
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
8+
PlutoStaticHTML = "359b1769-a58e-495b-9770-312e911026ad"
89
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"

docs/make.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ using GenericTensorNetworks
33
using GenericTensorNetworks: TropicalNumbers, Polynomials, Mods, OMEinsum, OMEinsumContractionOrders
44
using Documenter
55
using DocThemeIndigo
6+
using PlutoStaticHTML
67
using Literate
78

89
for 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)
1516
end
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+
1734
indigo = DocThemeIndigo.install(GenericTensorNetworks)
1835
DocMeta.setdocmeta!(GenericTensorNetworks, :DocTestSetup, :(using GenericTensorNetworks); recursive=true)
1936

0 commit comments

Comments
 (0)