Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/doc-preview-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Doc Preview Cleanup

on:
pull_request:
types: [closed]

# Ensure that only one "Doc Preview Cleanup" workflow is force pushing at a time
concurrency:
group: doc-preview-cleanup
cancel-in-progress: false

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.fork == false
# This workflow pushes to gh-pages; permissions are per-job and independent of docs.yml
permissions:
contents: write
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Delete preview and history + push changes
run: |
if [ -d "${preview_dir}" ]; then
git config user.name "Documenter.jl"
git config user.email "documenter@juliadocs.github.io"
git rm -rf "${preview_dir}"
git commit -m "delete preview"
git branch gh-pages-new "$(echo "delete history" | git commit-tree "HEAD^{tree}")"
git push --force origin gh-pages-new:gh-pages
fi
env:
preview_dir: previews/PR${{ github.event.number }}
3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
InfrastructureOptimizationModels = "bed98974-b02a-5e2f-9ee0-a103f5c45069"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"

[compat]
Documenter = "^1.0"
Expand Down
17 changes: 13 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
using Documenter
import DataStructures: OrderedDict
using InfrastructureOptimizationModels
using DocumenterInterLinks

links = InterLinks(
"PowerSystems" => "https://nrel-sienna.github.io/PowerSystems.jl/stable/",
"PowerSimulations" => "https://nrel-sienna.github.io/PowerSimulations.jl/stable/",
)

include(joinpath(@__DIR__, "make_tutorials.jl"))
make_tutorials()

pages = OrderedDict(
"Welcome Page" => "index.md",
"Tutorials" => Any["stub" => "tutorials/stub.md"],
"How to..." => Any["stub" => "how_to_guides/stub.md"],
"Explanation" => Any["stub" => "explanation/stub.md"],
# "Tutorials" => Any["stub" => "tutorials/generated_stub.md"],
# "How to..." => Any["stub" => "how_to_guides/stub.md"],
# "Explanation" => Any["stub" => "explanation/stub.md"],
"Reference" => Any[
"Developers" => ["Developer Guidelines" => "reference/developer_guidelines.md",
"Internals" => "reference/internal.md"],
"Public API" => "reference/public.md",
"Quadratic Approximations" => "reference/quadratic_approximations.md",
"Stub" => "reference/stub.md"
],
)

Expand All @@ -25,6 +33,7 @@ makedocs(
authors = "NREL-Sienna",
pages = Any[p for p in pages],
draft = false,
plugins = [links],
)

deploydocs(
Expand Down
Loading
Loading