@@ -21,111 +21,115 @@ Building aggregate site into: $(outpath)
2121@info " Building Documenter site for ITensorDocsNext"
2222include (" make_index.jl" )
2323Documenter. makedocs (;
24- sitename= " ITensor ecosystem docs" ,
25- modules= [ITensorDocsNext],
26- warnonly= true ,
27- format= Documenter. HTML (; assets= [" assets/favicon.ico" , " assets/extras.css" ]),
28- pages= [" index.md" , " ecosystem_overview.md" , " upgrade_guide.md" ],
24+ sitename = " ITensor ecosystem docs" ,
25+ modules = [ITensorDocsNext],
26+ warnonly = true ,
27+ format = Documenter. HTML (; assets = [" assets/favicon.ico" , " assets/extras.css" ]),
28+ pages = [" index.md" , " ecosystem_overview.md" , " upgrade_guide.md" ],
2929)
3030
3131@info " Building aggregate ITensorDocsNext site"
32- function itensor_multidocref (pkgname:: String ; clonedir:: String = clonedir)
33- return MultiDocumenter. MultiDocRef (;
34- upstream= joinpath (clonedir, pkgname),
35- path= pkgname,
36- name= pkgname,
37- giturl= " https://github.com/ITensor/$(pkgname) .jl.git" ,
38- )
32+ function itensor_multidocref (pkgname:: String ; clonedir:: String = clonedir)
33+ return MultiDocumenter. MultiDocRef (;
34+ upstream = joinpath (clonedir, pkgname),
35+ path = pkgname,
36+ name = pkgname,
37+ giturl = " https://github.com/ITensor/$(pkgname) .jl.git" ,
38+ )
3939end
4040docs = [
41- # We also add ITensorDocsNext's own generated pages
42- MultiDocumenter. MultiDocRef (;
43- upstream= joinpath (@__DIR__ , " build" ),
44- path= " Overview" ,
45- name= " Home" ,
46- fix_canonical_url= false ,
47- ),
48- MultiDocumenter. DropdownNav (
49- " Tensor Network Libraries" , itensor_multidocref .([" ITensorNetworksNext" ])
50- ),
51- MultiDocumenter. DropdownNav (
52- " Array Libraries" ,
53- itensor_multidocref .([
54- " ITensorBase" ,
55- " NamedDimsArrays" ,
56- " TensorAlgebra" ,
57- " BlockSparseArrays" ,
58- " SparseArraysBase" ,
59- " DiagonalArrays" ,
60- " KroneckerArrays" ,
61- ]),
62- ),
63- MultiDocumenter. DropdownNav (
64- " Symmetric Tensors" , itensor_multidocref .([" FusionTensors" , " GradedArrays" ])
65- ),
66- MultiDocumenter. DropdownNav (
67- " Graph Libraries" , itensor_multidocref .([" NamedGraphs" , " DataGraphs" ])
68- ),
69- MultiDocumenter. DropdownNav (
70- " Developer Tools" ,
71- itensor_multidocref .([
72- " FunctionImplementations" ,
73- " TypeParameterAccessors" ,
74- " MapBroadcast" ,
75- " BackendSelection" ,
76- " ITensorPkgSkeleton" ,
77- ]),
78- ),
41+ # We also add ITensorDocsNext's own generated pages
42+ MultiDocumenter. MultiDocRef (;
43+ upstream = joinpath (@__DIR__ , " build" ),
44+ path = " Overview" ,
45+ name = " Home" ,
46+ fix_canonical_url = false ,
47+ ),
48+ MultiDocumenter. DropdownNav (
49+ " Tensor Network Libraries" , itensor_multidocref .([" ITensorNetworksNext" ])
50+ ),
51+ MultiDocumenter. DropdownNav (
52+ " Array Libraries" ,
53+ itensor_multidocref .(
54+ [
55+ " ITensorBase" ,
56+ " NamedDimsArrays" ,
57+ " TensorAlgebra" ,
58+ " BlockSparseArrays" ,
59+ " SparseArraysBase" ,
60+ " DiagonalArrays" ,
61+ " KroneckerArrays" ,
62+ ]
63+ ),
64+ ),
65+ MultiDocumenter. DropdownNav (
66+ " Symmetric Tensors" , itensor_multidocref .([" FusionTensors" , " GradedArrays" ])
67+ ),
68+ MultiDocumenter. DropdownNav (
69+ " Graph Libraries" , itensor_multidocref .([" NamedGraphs" , " DataGraphs" ])
70+ ),
71+ MultiDocumenter. DropdownNav (
72+ " Developer Tools" ,
73+ itensor_multidocref .(
74+ [
75+ " FunctionImplementations" ,
76+ " TypeParameterAccessors" ,
77+ " MapBroadcast" ,
78+ " BackendSelection" ,
79+ " ITensorPkgSkeleton" ,
80+ ]
81+ ),
82+ ),
7983]
8084
8185MultiDocumenter. make (
82- outpath,
83- docs;
84- search_engine= MultiDocumenter. SearchConfig (;
85- index_versions= [" stable" ], engine= MultiDocumenter. FlexSearch
86- ),
87- rootpath= " /ITensorDocsNext/" ,
88- canonical_domain= " https://itensor.github.io/" ,
89- sitemap= true ,
90- assets_dir= " docs/src/assets" ,
91- brand_image= MultiDocumenter. BrandImage (
92- " https://itensor.org" , joinpath (" assets" , " logo-dark.png" )
93- ),
86+ outpath,
87+ docs;
88+ search_engine = MultiDocumenter. SearchConfig (;
89+ index_versions = [" stable" ], engine = MultiDocumenter. FlexSearch
90+ ),
91+ rootpath = " /ITensorDocsNext/" ,
92+ canonical_domain = " https://itensor.github.io/" ,
93+ sitemap = true ,
94+ assets_dir = " docs/src/assets" ,
95+ brand_image = MultiDocumenter. BrandImage (
96+ " https://itensor.org" , joinpath (" assets" , " logo-dark.png" )
97+ ),
9498)
9599
96100if " deploy" in ARGS
97- @warn " Deploying to GitHub" ARGS
98- gitroot = normpath (joinpath (@__DIR__ , " .." ))
99- run (` git pull` )
100- outbranch = " gh-pages"
101- has_outbranch = true
102- if ! success (` git checkout $outbranch ` )
103- has_outbranch = false
104- if ! success (` git switch --orphan $outbranch ` )
105- @error " Cannot create new orphaned branch $outbranch ."
106- exit (1 )
101+ @warn " Deploying to GitHub" ARGS
102+ gitroot = normpath (joinpath (@__DIR__ , " .." ))
103+ run (` git pull` )
104+ outbranch = " gh-pages"
105+ has_outbranch = true
106+ if ! success (` git checkout $outbranch ` )
107+ has_outbranch = false
108+ if ! success (` git switch --orphan $outbranch ` )
109+ @error " Cannot create new orphaned branch $outbranch ."
110+ exit (1 )
111+ end
107112 end
108- end
109- for file in readdir (gitroot; join= true )
110- endswith (file, " .git" ) && continue
111- rm (file; force= true , recursive= true )
112- end
113- for file in readdir (outpath)
114- cp (joinpath (outpath, file), joinpath (gitroot, file))
115- end
116- run (` git add .` )
117- if success (` git commit -m 'Aggregate documentation'` )
118- @info " Pushing updated documentation."
119- if has_outbranch
120- run (` git push` )
113+ for file in readdir (gitroot; join = true )
114+ endswith (file, " .git" ) && continue
115+ rm (file; force = true , recursive = true )
116+ end
117+ for file in readdir (outpath)
118+ cp (joinpath (outpath, file), joinpath (gitroot, file))
119+ end
120+ run (` git add .` )
121+ if success (` git commit -m 'Aggregate documentation'` )
122+ @info " Pushing updated documentation."
123+ if has_outbranch
124+ run (` git push` )
125+ else
126+ run (` git push -u origin $outbranch ` )
127+ end
128+ run (` git checkout main` )
121129 else
122- run ( ` git push -u origin $outbranch ` )
130+ @info " No changes to aggregated documentation. "
123131 end
124- run (` git checkout main` )
125- else
126- @info " No changes to aggregated documentation."
127- end
128132else
129- @info " Skipping deployment, 'deploy' not passed. Generated files in docs/out." ARGS
130- cp (outpath, joinpath (@__DIR__ , " out" ); force= true )
133+ @info " Skipping deployment, 'deploy' not passed. Generated files in docs/out." ARGS
134+ cp (outpath, joinpath (@__DIR__ , " out" ); force = true )
131135end
0 commit comments