Skip to content

Commit 937226f

Browse files
authored
Reverted to previous docs page
1 parent a7aea4b commit 937226f

4 files changed

Lines changed: 39 additions & 223 deletions

File tree

.github/workflows/Documentation.yaml

Lines changed: 7 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ on:
88
pull_request:
99

1010
jobs:
11-
benders-docs:
12-
name: Docs (PlasmoBenders)
11+
build:
1312
permissions:
1413
actions: write
1514
contents: write
@@ -20,108 +19,12 @@ jobs:
2019
- uses: actions/checkout@v4
2120
- uses: julia-actions/setup-julia@latest
2221
with:
23-
version: '1.10'
22+
version: '1.6'
2423
- uses: julia-actions/cache@v1
25-
- name: Install dependencies (PlasmoBenders)
26-
env:
27-
DOC_PKG: PlasmoBenders
24+
- name: Install dependencies
2825
run: julia --project=docs/ docs/install.jl
29-
- name: Build and deploy (PlasmoBenders)
30-
env:
31-
DOC_PKG: PlasmoBenders
32-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33-
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
34-
run: julia --project=docs/ docs/make.jl
35-
36-
schwarz-docs:
37-
name: Docs (PlasmoSchwarz)
38-
needs: benders-docs
39-
permissions:
40-
actions: write
41-
contents: write
42-
pull-requests: read
43-
statuses: write
44-
runs-on: ubuntu-latest
45-
steps:
46-
- uses: actions/checkout@v4
47-
- uses: julia-actions/setup-julia@latest
48-
with:
49-
version: '1.10'
50-
- uses: julia-actions/cache@v1
51-
- name: Install dependencies (PlasmoSchwarz)
52-
env:
53-
DOC_PKG: PlasmoSchwarz
54-
run: julia --project=docs/ docs/install.jl
55-
- name: Build and deploy (PlasmoSchwarz)
56-
env:
57-
DOC_PKG: PlasmoSchwarz
58-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59-
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
60-
run: julia --project=docs/ docs/make.jl
61-
62-
docs-index:
63-
name: Docs (index)
64-
needs: [benders-docs, schwarz-docs]
65-
if: github.event_name == 'push' || github.event_name == 'pull_request' # TODO: remove PR after testing
66-
permissions:
67-
contents: write
68-
runs-on: ubuntu-latest
69-
steps:
70-
- name: Checkout gh-pages branch
71-
uses: actions/checkout@v4
72-
with:
73-
ref: gh-pages
74-
fetch-depth: 1
75-
- name: Create dev index with links
76-
run: |
77-
mkdir -p dev
78-
cat > dev/index.html <<'EOF'
79-
<!doctype html>
80-
<html lang="en">
81-
<head>
82-
<meta charset="utf-8" />
83-
<meta name="viewport" content="width=device-width, initial-scale=1" />
84-
<title>PlasmoAlgorithms.jl Docs</title>
85-
<style>
86-
body { font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; margin: 2rem; }
87-
h1 { margin-bottom: 0.5rem; }
88-
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1rem; }
89-
.card { border: 1px solid #e0e0e0; border-radius: 8px; padding: 1rem; }
90-
a { text-decoration: none; color: #0059b3; font-weight: 600; }
91-
small { color: #666; }
92-
</style>
93-
</head>
94-
<body>
95-
<h1>PlasmoAlgorithms.jl documentation</h1>
96-
<p>Select a sub-package:</p>
97-
<div class="cards">
98-
<div class="card">
99-
<a href="../benders/">PlasmoBenders</a>
100-
<div><small>Decomposition via Benders</small></div>
101-
</div>
102-
<div class="card">
103-
<a href="../schwarz/">PlasmoSchwarz</a>
104-
<div><small>Domain decomposition (Schwarz)</small></div>
105-
</div>
106-
</div>
107-
</body>
108-
</html>
109-
EOF
110-
- name: Commit and push index
26+
- name: Build and deploy
11127
env:
112-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113-
run: |
114-
git config user.name "github-actions[bot]"
115-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
116-
git add dev/index.html
117-
if git diff --cached --quiet; then
118-
echo "No changes to commit"
119-
else
120-
git commit -m "Update docs dev index with links to benders and schwarz"
121-
# Only push on push events (not PRs from forks which lack write perms)
122-
if [ "${{ github.event_name }}" = "push" ]; then
123-
git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git gh-pages
124-
else
125-
echo "Skipping push on PR (testing mode)"
126-
fi
127-
fi
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
29+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key
30+
run: julia --project=docs/ docs/make.jl

docs/install.jl

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@ using Pkg
22

33
PA_DIR = pwd()
44

5-
doc_pkg = get(ENV, "DOC_PKG", nothing)
6-
7-
if doc_pkg === nothing
8-
# Fallback: develop both (may conflict if dependencies are incompatible)
9-
@info "DOC_PKG not set; developing both PlasmoBenders and PlasmoSchwarz"
10-
Pkg.develop(path=joinpath(PA_DIR, "lib", "PlasmoBenders"))
11-
Pkg.develop(path=joinpath(PA_DIR, "lib", "PlasmoSchwarz"))
12-
else
13-
@info "Developing only $(doc_pkg) for docs build"
14-
Pkg.develop(path=joinpath(PA_DIR, "lib", doc_pkg))
15-
end
16-
5+
Pkg.develop(path=joinpath(PA_DIR, "lib", "PlasmoBenders"))
6+
Pkg.develop(path=joinpath(PA_DIR, "lib", "PlasmoSchwarz"))
177
Pkg.instantiate()

docs/make.jl

Lines changed: 29 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -2,117 +2,40 @@
22
# This Source Code Form is subject to the terms of the MIT License
33
# This source code is adapted from that of Plasmo.jl which can be found at https://github.com/plasmo-dev/Plasmo.jl/blob/main/docs/make.jl
44

5-
using Documenter, Plasmo, Suppressor, Graphs
6-
using Base: walkdir
7-
8-
doc_pkg = get(ENV, "DOC_PKG", "PlasmoBenders") # default to PlasmoBenders
9-
10-
if doc_pkg == "PlasmoBenders"
11-
@info "Building docs for PlasmoBenders"
12-
using PlasmoBenders
13-
DocMeta.setdocmeta!(PlasmoBenders, :DocTestSetup, :(using PlasmoBenders); recursive=true)
14-
elseif doc_pkg == "PlasmoSchwarz"
15-
@info "Building docs for PlasmoSchwarz"
16-
using PlasmoSchwarz
17-
DocMeta.setdocmeta!(PlasmoSchwarz, :DocTestSetup, :(using PlasmoSchwarz); recursive=true)
18-
else
19-
error("Unsupported DOC_PKG=$(doc_pkg). Expected PlasmoBenders or PlasmoSchwarz.")
20-
end
5+
using Documenter, Plasmo, Suppressor, Graphs, PlasmoBenders, PlasmoSchwarz
216

227
DocMeta.setdocmeta!(Plasmo, :DocTestSetup, :(using Plasmo); recursive=true)
23-
DocMeta.setdocmeta!(Plasmo, :DocTestSetup, :(using Plasmo); recursive=true)
24-
25-
pages_benders = [
26-
"Introduction" => "index.md",
27-
"PlasmoBenders.jl" => [
28-
"Introduction" => "PlasmoBenders/introduction.md",
29-
"Algorithm" => "PlasmoBenders/algorithm.md",
30-
"Quickstart" => "PlasmoBenders/quickstart.md",
31-
"Solver Options" => "PlasmoBenders/solver.md",
32-
"Exploiting Graph Structure" => "PlasmoBenders/graph_structure.md",
33-
"API Documentation" => "PlasmoBenders/api_docs.md",
34-
"Tutorials" => [
35-
"Storage Operation" => "PlasmoBenders/storage_tutorial.md",
36-
"Equipment Sizing" => "PlasmoBenders/sizing_tutorial.md"
37-
],
38-
],
39-
]
40-
41-
pages_schwarz = [
42-
"Introduction" => "index.md",
43-
"PlasmoSchwarz.jl" => [
44-
"Introduction" => "PlasmoSchwarz/introduction.md",
45-
"Quickstart" => "PlasmoSchwarz/quickstart.md",
46-
"Algorithm" => "PlasmoSchwarz/algorithm.md",
47-
"API Documentation" => "PlasmoSchwarz/api_docs.md",
48-
]
49-
]
8+
DocMeta.setdocmeta!(PlasmoBenders, :DocTestSetup, :(using PlasmoBenders); recursive=true)
9+
DocMeta.setdocmeta!(PlasmoSchwarz, :DocTestSetup, :(using PlasmoSchwarz); recursive=true)
5010

51-
modules_sel = doc_pkg == "PlasmoBenders" ? [PlasmoBenders] : [PlasmoSchwarz]
52-
pages_sel = doc_pkg == "PlasmoBenders" ? pages_benders : pages_schwarz
53-
54-
# Build in a filtered temporary source directory to avoid processing pages
55-
# of the other package when building docs for one package.
56-
src_root = joinpath(@__DIR__, "src")
57-
tmp_src = mktempdir()
58-
59-
# Always include index.md
60-
mkpath(tmp_src)
61-
cp(joinpath(src_root, "index.md"), joinpath(tmp_src, "index.md"); force=true)
62-
63-
# Include shared figures folder so relative image links work
64-
fig_src = joinpath(src_root, "figures")
65-
fig_dst = joinpath(tmp_src, "figures")
66-
if isdir(fig_src)
67-
mkpath(fig_dst)
68-
for (root, dirs, files) in walkdir(fig_src)
69-
rel = replace(root, fig_src => "")
70-
target_root = joinpath(fig_dst, rel)
71-
mkpath(target_root)
72-
for f in files
73-
cp(joinpath(root, f), joinpath(target_root, f); force=true)
74-
end
75-
end
76-
end
77-
78-
if doc_pkg == "PlasmoBenders"
79-
# Copy only PlasmoBenders pages directory
80-
src_dir = joinpath(src_root, "PlasmoBenders")
81-
dest_dir = joinpath(tmp_src, "PlasmoBenders")
82-
mkpath(dest_dir)
83-
for (root, dirs, files) in walkdir(src_dir)
84-
rel = replace(root, src_dir => "")
85-
target_root = joinpath(dest_dir, rel)
86-
mkpath(target_root)
87-
for f in files
88-
cp(joinpath(root, f), joinpath(target_root, f); force=true)
89-
end
90-
end
91-
else
92-
# Copy only PlasmoSchwarz pages directory
93-
src_dir = joinpath(src_root, "PlasmoSchwarz")
94-
dest_dir = joinpath(tmp_src, "PlasmoSchwarz")
95-
mkpath(dest_dir)
96-
for (root, dirs, files) in walkdir(src_dir)
97-
rel = replace(root, src_dir => "")
98-
target_root = joinpath(dest_dir, rel)
99-
mkpath(target_root)
100-
for f in files
101-
cp(joinpath(root, f), joinpath(target_root, f); force=true)
102-
end
103-
end
104-
end
105-
106-
makedocs(;
107-
sitename="PlasmoAlgorithms.jl - $(doc_pkg)",
108-
modules=modules_sel,
11+
makedocs(;
12+
sitename="PlasmoAlgorithms.jl",
13+
modules=[PlasmoBenders],
10914
doctest=true,
11015
checkdocs=:export,
111-
source=tmp_src,
112-
format=Documenter.HTML(; prettyurls=get(ENV, "CI", nothing) == "true", edit_link = nothing),
16+
format=Documenter.HTML(; prettyurls=get(ENV, "CI", nothing) == "true"),
11317
authors="Jordan Jalving and David Cole",
114-
pages=pages_sel,
18+
pages=[
19+
"Introduction" => "index.md",
20+
"PlasmoBenders.jl" => [
21+
"Introduction" => "PlasmoBenders/introduction.md",
22+
"Algorithm" => "PlasmoBenders/algorithm.md",
23+
"Quickstart" => "PlasmoBenders/quickstart.md",
24+
"Solver Options" => "PlasmoBenders/solver.md",
25+
"Exploiting Graph Structure" => "PlasmoBenders/graph_structure.md",
26+
"API Documentation" => "PlasmoBenders/api_docs.md",
27+
"Tutorials" => [
28+
"Storage Operation" => "PlasmoBenders/storage_tutorial.md",
29+
"Equipment Sizing" => "PlasmoBenders/sizing_tutorial.md"
30+
],
31+
],
32+
"PlasmoSchwarz.jl" => [
33+
"Introduction" => "PlasmoSchwarz/introduction.md",
34+
"Quickstart" => "PlasmoSchwarz/quickstart.md",
35+
"Algorithm" => "PlasmoSchwarz/algorithm.md",
36+
"API Documentation" => "PlasmoSchwarz/api_docs.md",
37+
]
38+
],
11539
)
11640

117-
devurl = doc_pkg == "PlasmoBenders" ? "benders" : "schwarz"
118-
deploydocs(; repo="github.com/plasmo-dev/PlasmoAlgorithms.jl.git", devurl=devurl)
41+
deploydocs(; repo="github.com/plasmo-dev/PlasmoAlgorithms.jl.git")

lib/PlasmoSchwarz/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ DataStructures = "0.18"
1818
JuMP = "1.2"
1919
MathOptInterface = "1.6"
2020
Metis = "1.5"
21-
Plasmo = "^0.6.2"
21+
Plasmo = "0.7"
2222

2323
[extras]
2424
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"

0 commit comments

Comments
 (0)