diff --git a/.github/workflows/multidocs.yml b/.github/workflows/multidocs.yml index 46418813d..6f7348ce2 100644 --- a/.github/workflows/multidocs.yml +++ b/.github/workflows/multidocs.yml @@ -1,4 +1,4 @@ -name: MultiDocumentation +name: Docs on: push: @@ -8,87 +8,26 @@ on: pull_request: jobs: - build_multidocs: + docs: runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v2 with: - version: '1.10.5' + version: '1' - uses: julia-actions/cache@v2 - - - name: Set up - run: git config --global init.defaultBranch master - - - name: Build GNNGraphs docs - run: - julia --project=GNNGraphs/docs/ -e ' - using Pkg; - pkg"dev ./GNNGraphs"; - Pkg.instantiate(); - include("GNNGraphs/docs/make.jl")' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - - - name: Build GNNlib docs - run: julia --project=GNNlib/docs/ -e ' - using Pkg; - pkg"dev ./GNNlib ./GNNGraphs"; - Pkg.instantiate(); - include("GNNlib/docs/make.jl")' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - - - name: Build GNNLux docs - run: julia --project=GNNLux/docs/ -e ' - using Pkg; - pkg"dev ./GNNLux ./GNNlib ./GNNGraphs"; - Pkg.instantiate(); - include("GNNLux/docs/make.jl")' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - - - name: Build GraphNeuralNetworks docs - run: julia --project=GraphNeuralNetworks/docs/ -e ' - using Pkg; - pkg"dev ./GraphNeuralNetworks ./GNNlib ./GNNGraphs"; - Pkg.instantiate(); - include("GraphNeuralNetworks/docs/make.jl")' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - - - # Build and deploy multidocs - - name: Install dependencies for multidocs - run: julia --project=docs/ -e ' - using Pkg; - pkg"dev ./GraphNeuralNetworks ./GNNlib ./GNNGraphs ./GNNLux"; - Pkg.instantiate();' - - name: Check if objects.inv exists for GraphNeuralNetworks - run: | - if [ -f GraphNeuralNetworks/docs/build/objects.inv ]; then - echo "GraphNeuralNetworks: objects.inv exists." - else - echo "GraphNeuralNetworks: objects.inv does not exist!" && exit 1 - fi - - name: Config git - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + # Build individual docs + - run: julia GNNGraphs/docs/make.jl + - run: julia GNNlib/docs/make.jl + - run: julia GNNLux/docs/make.jl + - run: julia GraphNeuralNetworks/docs/make.jl + # Compile multi docs + - name: MultiDocs run: | git config user.name github-actions git config user.email github-actions@github.com - - - name: Build multidocs - if: github.event_name == 'pull_request' - run: | - julia --project=docs/ docs/make-multi.jl PR - - - name: Build and deploy multidocs - if: github.event_name != 'pull_request' - run: | - julia --project=docs/ docs/make-multi.jl \ No newline at end of file + julia --project=docs/ -e 'using Pkg; Pkg.instantiate()' + julia --project=docs/ docs/make-multi.jl diff --git a/GNNGraphs/docs/Project.toml b/GNNGraphs/docs/Project.toml index f88de7ceb..6d6ed11be 100644 --- a/GNNGraphs/docs/Project.toml +++ b/GNNGraphs/docs/Project.toml @@ -3,7 +3,6 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656" GNNGraphs = "aed8fd31-079b-4b5a-b342-a13352159b8c" Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" -LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589" MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458" MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" diff --git a/GNNGraphs/docs/make.jl b/GNNGraphs/docs/make.jl index 1e95d1654..30a3a2f56 100644 --- a/GNNGraphs/docs/make.jl +++ b/GNNGraphs/docs/make.jl @@ -1,3 +1,8 @@ +using Pkg +Pkg.activate(@__DIR__) +Pkg.develop(path=joinpath(@__DIR__, "..")) +Pkg.instantiate() + using Documenter using DocumenterInterLinks using GNNGraphs @@ -27,25 +32,29 @@ makedocs(; size_threshold=nothing, size_threshold_warn=200000),sitename = "GNNGraphs.jl", pages = [ - "Home" => "index.md", - - "Guides" => [ - "Graphs" => "guides/gnngraph.md", - "Heterogeneous Graphs" => "guides/heterograph.md", - "Temporal Graphs" => "guides/temporalgraph.md", - "Datasets" => "guides/datasets.md", - ], + "Home" => "index.md", + + "Guides" => [ + "Graphs" => "guides/gnngraph.md", + "Heterogeneous Graphs" => "guides/heterograph.md", + "Temporal Graphs" => "guides/temporalgraph.md", + "Datasets" => "guides/datasets.md", + ], - "API Reference" => [ - "GNNGraph" => "api/gnngraph.md", - "GNNHeteroGraph" => "api/heterograph.md", - "TemporalSnapshotsGNNGraph" => "api/temporalgraph.md", - "Samplers" => "api/samplers.md", - ], + "API Reference" => [ + "GNNGraph" => "api/gnngraph.md", + "GNNHeteroGraph" => "api/heterograph.md", + "TemporalSnapshotsGNNGraph" => "api/temporalgraph.md", + "Samplers" => "api/samplers.md", + "Datasets" => "api/datasets.md", + ], ] ) - -deploydocs(repo = "github.com/JuliaGraphs/GraphNeuralNetworks.jl.git", - devbranch = "master", - dirname = "GNNGraphs", - tag_prefix="GNNGraphs-") \ No newline at end of file + +deploydocs( + repo = "github.com/JuliaGraphs/GraphNeuralNetworks.jl", + target = "build", + branch = "docs-gnngraphs", + devbranch = "master", + tag_prefix="GNNGraphs-", +) diff --git a/GNNGraphs/docs/src/api/datasets.md b/GNNGraphs/docs/src/api/datasets.md new file mode 100644 index 000000000..745053691 --- /dev/null +++ b/GNNGraphs/docs/src/api/datasets.md @@ -0,0 +1,10 @@ +```@meta +CurrentModule = GNNGraphs +CollapsedDocStrings = true +``` + +# Datasets + +```@docs +mldataset2gnngraph +``` diff --git a/GNNGraphs/docs/src/api/gnngraph.md b/GNNGraphs/docs/src/api/gnngraph.md index 47b4040a2..bd344fec4 100644 --- a/GNNGraphs/docs/src/api/gnngraph.md +++ b/GNNGraphs/docs/src/api/gnngraph.md @@ -21,7 +21,7 @@ Base.copy ## DataStore -```@autodocs +```@autodocs; canonical = true Modules = [GNNGraphs] Pages = ["datastore.jl"] Private = false @@ -29,19 +29,19 @@ Private = false ## Query -```@autodocs +```@autodocs; canonical = true Modules = [GNNGraphs] Pages = ["src/query.jl"] Private = false ``` -```@docs +```@docs; canonical = true Graphs.neighbors(::GNNGraph, ::Integer) ``` ## Transform -```@autodocs +```@autodocs; canonical = true Modules = [GNNGraphs] Pages = ["src/transform.jl"] Private = false @@ -49,14 +49,14 @@ Private = false ## Utils -```@docs +```@docs; canonical = true GNNGraphs.sort_edge_index GNNGraphs.color_refinement ``` ## Generate -```@autodocs +```@autodocs; canonical = true Modules = [GNNGraphs] Pages = ["src/generate.jl"] Private = false @@ -65,24 +65,24 @@ Filter = t -> typeof(t) <: Function && t!=rand_temporal_radius_graph && t!=rand_ ## Operators -```@autodocs +```@autodocs; canonical = true Modules = [GNNGraphs] Pages = ["src/operators.jl"] Private = false ``` -```@docs +```@docs; canonical = true Base.intersect ``` ## Sampling -```@autodocs +```@autodocs; canonical = true Modules = [GNNGraphs] Pages = ["src/sampling.jl"] Private = false ``` -```@docs +```@docs; canonical = true Graphs.induced_subgraph(::GNNGraph, ::Vector{Int}) ``` \ No newline at end of file diff --git a/GNNGraphs/docs/src/guides/datasets.md b/GNNGraphs/docs/src/guides/datasets.md index 60477d95e..99c741c92 100644 --- a/GNNGraphs/docs/src/guides/datasets.md +++ b/GNNGraphs/docs/src/guides/datasets.md @@ -5,6 +5,3 @@ For graphs with static structures and temporal features, datasets such as METRLA GraphNeuralNetworks.jl provides the [`mldataset2gnngraph`](@ref) method for interfacing with MLDatasets.jl. -```@docs -mldataset2gnngraph -``` diff --git a/GNNLux/docs/make.jl b/GNNLux/docs/make.jl index b4b37c66d..d1f0bbadb 100644 --- a/GNNLux/docs/make.jl +++ b/GNNLux/docs/make.jl @@ -1,3 +1,10 @@ +using Pkg +Pkg.activate(@__DIR__) +Pkg.develop(path=joinpath(@__DIR__, "..", "..", "GNNGraphs")) +Pkg.develop(path=joinpath(@__DIR__, "..", "..", "GNNlib")) +Pkg.develop(path=joinpath(@__DIR__, "..")) +Pkg.instantiate() + using Documenter using GNNLux using Lux, GNNGraphs, GNNlib, Graphs @@ -18,9 +25,7 @@ mathengine = MathJax3(Dict(:loader => Dict("load" => ["[tex]/require", "[tex]/ma interlinks = InterLinks( "NNlib" => "https://fluxml.ai/NNlib.jl/stable/", - # "GNNGraphs" => ("https://carlolucibello.github.io/GraphNeuralNetworks.jl/GNNGraphs/", joinpath(dirname(dirname(@__DIR__)), "GNNGraphs", "docs", "build", "objects.inv")), - # "GNNlib" => ("https://carlolucibello.github.io/GraphNeuralNetworks.jl/GNNlib/", joinpath(dirname(dirname(@__DIR__)), "GNNlib", "docs", "build", "objects.inv")) - ) +) # Copy the docs from GNNGraphs and GNNlib. Will be removed at the end of the script cp(joinpath(@__DIR__, "../../GNNGraphs/docs/src"), @@ -29,64 +34,67 @@ cp(joinpath(@__DIR__, "../../GNNlib/docs/src"), joinpath(@__DIR__, "src/GNNlib"), force=true) makedocs(; - modules = [GNNLux, GNNGraphs, GNNlib], - doctest = false, # TODO: enable doctest - plugins = [interlinks], - format = Documenter.HTML(; mathengine, - prettyurls = get(ENV, "CI", nothing) == "true", - assets = [], - size_threshold=nothing, - size_threshold_warn=2000000), - sitename = "GNNLux.jl", - pages = [ + modules = [GNNLux, GNNGraphs, GNNlib], + doctest = false, # TODO: enable doctest + plugins = [interlinks], + format = Documenter.HTML(; mathengine, + prettyurls = get(ENV, "CI", nothing) == "true", + assets = [], + size_threshold=nothing, + size_threshold_warn=2000000), + sitename = "GNNLux.jl", + pages = [ + + "Home" => "index.md", - "Home" => "index.md", - - "Guides" => [ - "Graphs" => "GNNGraphs/guides/gnngraph.md", - "Message Passing" => "GNNlib/guides/messagepassing.md", - "Models" => "guides/models.md", - "Datasets" => "GNNGraphs/guides/datasets.md", - "Heterogeneous Graphs" => "GNNGraphs/guides/heterograph.md", - "Temporal Graphs" => "GNNGraphs/guides/temporalgraph.md", - ], + "Guides" => [ + "Graphs" => "GNNGraphs/guides/gnngraph.md", + "Message Passing" => "GNNlib/guides/messagepassing.md", + "Models" => "guides/models.md", + "Datasets" => "GNNGraphs/guides/datasets.md", + "Heterogeneous Graphs" => "GNNGraphs/guides/heterograph.md", + "Temporal Graphs" => "GNNGraphs/guides/temporalgraph.md", + ], - "Tutorials" => [ - "Introductory tutorials" => [ - "Hands on" => "tutorials/gnn_intro.md", + "Tutorials" => [ + "Introductory tutorials" => [ + "Hands on" => "tutorials/gnn_intro.md", + ], ], - ], - "API Reference" => [ - "Graphs (GNNGraphs.jl)" => [ - "GNNGraph" => "GNNGraphs/api/gnngraph.md", - "GNNHeteroGraph" => "GNNGraphs/api/heterograph.md", - "TemporalSnapshotsGNNGraph" => "GNNGraphs/api/temporalgraph.md", - "Samplers" => "GNNGraphs/api/samplers.md", - ] + "API Reference" => [ + "Graphs (GNNGraphs.jl)" => [ + "GNNGraph" => "GNNGraphs/api/gnngraph.md", + "GNNHeteroGraph" => "GNNGraphs/api/heterograph.md", + "TemporalSnapshotsGNNGraph" => "GNNGraphs/api/temporalgraph.md", + "Samplers" => "GNNGraphs/api/samplers.md", + "Datasets" => "GNNGraphs/api/datasets.md", + ] - "Message Passing (GNNlib.jl)" => [ - "Message Passing" => "GNNlib/api/messagepassing.md", - "Other Operators" => "GNNlib/api/utils.md", - ] + "Message Passing (GNNlib.jl)" => [ + "Message Passing" => "GNNlib/api/messagepassing.md", + "Other Operators" => "GNNlib/api/utils.md", + ] - "Layers" => [ - "Basic layers" => "api/basic.md", - "Convolutional layers" => "api/conv.md", - # "Pooling layers" => "api/pool.md", - "Temporal Convolutional layers" => "api/temporalconv.md", - # "Hetero Convolutional layers" => "api/heteroconv.md", - ] - ], - - # "Developer guide" => "dev.md", + "Layers" => [ + "Basic layers" => "api/basic.md", + "Convolutional layers" => "api/conv.md", + # "Pooling layers" => "api/pool.md", + "Temporal Convolutional layers" => "api/temporalconv.md", + # "Hetero Convolutional layers" => "api/heteroconv.md", + ] + ], + + # "Developer guide" => "dev.md", ], ) rm(joinpath(@__DIR__, "src/GNNGraphs"), force=true, recursive=true) rm(joinpath(@__DIR__, "src/GNNlib"), force=true, recursive=true) - -deploydocs(repo = "github.com/JuliaGraphs/GraphNeuralNetworks.jl.git", - devbranch = "master", - dirname = "GNNLux", - tag_prefix="GNNLux-") \ No newline at end of file + +deploydocs( + repo = "github.com/JuliaGraphs/GraphNeuralNetworks.jl", + branch = "docs-gnnlux", + devbranch = "master", + tag_prefix="GNNLux-", +) diff --git a/GNNlib/docs/Project.toml b/GNNlib/docs/Project.toml index 5aa458b91..573ea3e88 100644 --- a/GNNlib/docs/Project.toml +++ b/GNNlib/docs/Project.toml @@ -4,4 +4,3 @@ DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656" GNNGraphs = "aed8fd31-079b-4b5a-b342-a13352159b8c" GNNlib = "a6a84749-d869-43f8-aacc-be26a1996e48" Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" -LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589" diff --git a/GNNlib/docs/make.jl b/GNNlib/docs/make.jl index ca98e4519..0141ad809 100644 --- a/GNNlib/docs/make.jl +++ b/GNNlib/docs/make.jl @@ -1,39 +1,56 @@ +using Pkg +Pkg.activate(@__DIR__) +Pkg.develop(path=joinpath(@__DIR__, "..", "..", "GNNGraphs")) +Pkg.develop(path=joinpath(@__DIR__, "..")) +Pkg.instantiate() + using Documenter using GNNlib using GNNGraphs +import Graphs using DocumenterInterLinks - assets=[] prettyurls = get(ENV, "CI", nothing) == "true" mathengine = MathJax3() interlinks = InterLinks( "NNlib" => "https://fluxml.ai/NNlib.jl/stable/", - "GNNGraphs" => ("https://carlolucibello.github.io/GraphNeuralNetworks.jl/GNNGraphs/", joinpath(dirname(dirname(@__DIR__)), "GNNGraphs", "docs", "build", "objects.inv"))) +) +# Copy the docs from GNNGraphs. Will be removed at the end of the script +cp(joinpath(@__DIR__, "../../GNNGraphs/docs/src/"), + joinpath(@__DIR__, "src/GNNGraphs/"), force=true) makedocs(; - modules = [GNNlib], - doctest = false, - clean = true, - plugins = [interlinks], - format = Documenter.HTML(; mathengine, prettyurls, assets = assets, size_threshold=nothing), - sitename = "GNNlib.jl", - pages = ["Home" => "index.md", - "Message Passing" => "guides/messagepassing.md", + modules = [GNNlib, GNNGraphs], + doctest = false, # TODO enable doctest + plugins = [interlinks], + format = Documenter.HTML(; mathengine, prettyurls, assets = assets, size_threshold=nothing), + sitename = "GNNlib.jl", + pages = [ + "Home" => "index.md", + "Message Passing" => "guides/messagepassing.md", + "API Reference" => [ + "Graphs (GNNGraphs.jl)" => [ + "GNNGraph" => "GNNGraphs/api/gnngraph.md", + "GNNHeteroGraph" => "GNNGraphs/api/heterograph.md", + "TemporalSnapshotsGNNGraph" => "GNNGraphs/api/temporalgraph.md", + "Samplers" => "GNNGraphs/api/samplers.md", + "Datasets" => "GNNGraphs/api/datasets.md", + ], + "Message Passing" => "api/messagepassing.md", + "Utils" => "api/utils.md", + ] + ] +) + +rm(joinpath(@__DIR__, "src/GNNGraphs"), force=true, recursive=true) - "API Reference" => [ - - "Message Passing" => "api/messagepassing.md", - - "Utils" => "api/utils.md", - ] - - ] - ) - -deploydocs(;repo = "github.com/JuliaGraphs/GraphNeuralNetworks.jl.git", - devbranch = "master", - dirname = "GNNlib", - tag_prefix="GNNlib-") \ No newline at end of file +deploydocs( + repo = "github.com/JuliaGraphs/GraphNeuralNetworks.jl", + target = "build", + branch = "docs-gnnlib", + devbranch = "master", + tag_prefix="GNNlib-", +) diff --git a/GNNlib/src/msgpass.jl b/GNNlib/src/msgpass.jl index f6a1cf659..7bbe2ab58 100644 --- a/GNNlib/src/msgpass.jl +++ b/GNNlib/src/msgpass.jl @@ -22,7 +22,7 @@ providing as input `f` a closure. - `g`: A `GNNGraph`. - `xi`: An array or a named tuple containing arrays whose last dimension's size is `g.num_nodes`. It will be appropriately materialized on the - target node of each edge (see also [`edge_index`](@ref)). + target node of each edge (see also [`edge_index`](@ref GNNGraphs.edge_index)). - `xj`: As `xj`, but to be materialized on edges' sources. - `e`: An array or a named tuple containing arrays whose last dimension's size is `g.num_edges`. - `fmsg`: A generic function that will be passed over to [`apply_edges`](@ref). @@ -100,7 +100,7 @@ such tensors. - `g`: An `AbstractGNNGraph`. - `xi`: An array or a named tuple containing arrays whose last dimension's size is `g.num_nodes`. It will be appropriately materialized on the - target node of each edge (see also [`edge_index`](@ref)). + target node of each edge (see also [`edge_index`](@ref GNNGraphs.edge_index)). - `xj`: As `xi`, but now to be materialized on each edge's source node. - `e`: An array or a named tuple containing arrays whose last dimension's size is `g.num_edges`. - `fmsg`: A function that takes as inputs the edge-materialized `xi`, `xj`, and `e`. diff --git a/GraphNeuralNetworks/docs/make.jl b/GraphNeuralNetworks/docs/make.jl index ca95be3e6..a5ff601ff 100644 --- a/GraphNeuralNetworks/docs/make.jl +++ b/GraphNeuralNetworks/docs/make.jl @@ -1,3 +1,10 @@ +using Pkg +Pkg.activate(@__DIR__) +Pkg.develop(path=joinpath(@__DIR__, "..", "..", "GNNGraphs")) +Pkg.develop(path=joinpath(@__DIR__, "..", "..", "GNNlib")) +Pkg.develop(path=joinpath(@__DIR__, "..")) +Pkg.instantiate() + using Documenter using GraphNeuralNetworks using Flux, GNNGraphs, GNNlib, Graphs @@ -18,9 +25,7 @@ mathengine = MathJax3(Dict(:loader => Dict("load" => ["[tex]/require", "[tex]/ma interlinks = InterLinks( "NNlib" => "https://fluxml.ai/NNlib.jl/stable/", - # "GNNGraphs" => ("https://carlolucibello.github.io/GraphNeuralNetworks.jl/GNNGraphs/", joinpath(dirname(dirname(@__DIR__)), "GNNGraphs", "docs", "build", "objects.inv")), - # "GNNlib" => ("https://carlolucibello.github.io/GraphNeuralNetworks.jl/GNNlib/", joinpath(dirname(dirname(@__DIR__)), "GNNlib", "docs", "build", "objects.inv")) - ) +) # Copy the docs from GNNGraphs and GNNlib. Will be removed at the end of the script cp(joinpath(@__DIR__, "../../GNNGraphs/docs/src"), @@ -39,60 +44,64 @@ makedocs(; size_threshold_warn=2000000), sitename = "GraphNeuralNetworks.jl", pages = [ - - "Home" => "index.md", - - "Guides" => [ - "Graphs" => "GNNGraphs/guides/gnngraph.md", - "Message Passing" => "GNNlib/guides/messagepassing.md", - "Models" => "guides/models.md", - "Datasets" => "GNNGraphs/guides/datasets.md", - "Heterogeneous Graphs" => "GNNGraphs/guides/heterograph.md", - "Temporal Graphs" => "GNNGraphs/guides/temporalgraph.md", - ], - "Tutorials" => [ - "Introductory tutorials" => [ - "Hands on" => "tutorials/gnn_intro_pluto.md", - "Node classification" => "tutorials/node_classification_pluto.md", - "Graph classification" => "tutorials/graph_classification_pluto.md" + "Home" => "index.md", + + "Guides" => [ + "Graphs" => "GNNGraphs/guides/gnngraph.md", + "Message Passing" => "GNNlib/guides/messagepassing.md", + "Models" => "guides/models.md", + "Datasets" => "GNNGraphs/guides/datasets.md", + "Heterogeneous Graphs" => "GNNGraphs/guides/heterograph.md", + "Temporal Graphs" => "GNNGraphs/guides/temporalgraph.md", + ], + + "Tutorials" => [ + "Introductory tutorials" => [ + "Hands on" => "tutorials/gnn_intro_pluto.md", + "Node classification" => "tutorials/node_classification_pluto.md", + "Graph classification" => "tutorials/graph_classification_pluto.md" + ], + "Temporal graph neural networks" =>[ + "Node autoregression" => "tutorials/traffic_prediction.md", + "Temporal graph classification" => "tutorials/temporal_graph_classification_pluto.md" ], - "Temporal graph neural networks" =>[ - "Node autoregression" => "tutorials/traffic_prediction.md", - "Temporal graph classification" => "tutorials/temporal_graph_classification_pluto.md" ], - ], - "API Reference" => [ - "Graphs (GNNGraphs.jl)" => [ - "GNNGraph" => "GNNGraphs/api/gnngraph.md", - "GNNHeteroGraph" => "GNNGraphs/api/heterograph.md", - "TemporalSnapshotsGNNGraph" => "GNNGraphs/api/temporalgraph.md", - "Samplers" => "GNNGraphs/api/samplers.md", - ] + "API Reference" => [ + "Graphs (GNNGraphs.jl)" => [ + "GNNGraph" => "GNNGraphs/api/gnngraph.md", + "GNNHeteroGraph" => "GNNGraphs/api/heterograph.md", + "TemporalSnapshotsGNNGraph" => "GNNGraphs/api/temporalgraph.md", + "Samplers" => "GNNGraphs/api/samplers.md", + "Datasets" => "GNNGraphs/api/datasets.md", + ] - "Message Passing (GNNlib.jl)" => [ - "Message Passing" => "GNNlib/api/messagepassing.md", - "Other Operators" => "GNNlib/api/utils.md", - ] + "Message Passing (GNNlib.jl)" => [ + "Message Passing" => "GNNlib/api/messagepassing.md", + "Other Operators" => "GNNlib/api/utils.md", + ] - "Layers" => [ - "Basic layers" => "api/basic.md", - "Convolutional layers" => "api/conv.md", - "Pooling layers" => "api/pool.md", - "Temporal Convolutional layers" => "api/temporalconv.md", - "Hetero Convolutional layers" => "api/heteroconv.md", - ] + "Layers" => [ + "Basic layers" => "api/basic.md", + "Convolutional layers" => "api/conv.md", + "Pooling layers" => "api/pool.md", + "Temporal Convolutional layers" => "api/temporalconv.md", + "Hetero Convolutional layers" => "api/heteroconv.md", + ] ], - - "Developer guide" => "dev.md", + + "Developer guide" => "dev.md", ], ) rm(joinpath(@__DIR__, "src/GNNGraphs"), force=true, recursive=true) rm(joinpath(@__DIR__, "src/GNNlib"), force=true, recursive=true) -deploydocs(repo = "github.com/JuliaGraphs/GraphNeuralNetworks.jl.git", - devbranch = "master", - dirname= "GraphNeuralNetworks", - tag_prefix="GraphNeuralNetworks-") +deploydocs( + repo = "github.com/JuliaGraphs/GraphNeuralNetworks.jl", + branch = "docs-graphneuralnetworks", + devbranch = "master", + tag_prefix="GraphNeuralNetworks-", +) + diff --git a/docs/Project.toml b/docs/Project.toml index 8d7c1e6a6..6c1974efe 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,4 +1,3 @@ [deps] -LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589" MultiDocumenter = "87ed4bf0-c935-4a67-83c3-2a03bee4197c" diff --git a/docs/make-multi.jl b/docs/make-multi.jl index 5c4a8cadb..7b1b02f28 100644 --- a/docs/make-multi.jl +++ b/docs/make-multi.jl @@ -1,37 +1,28 @@ +# We use the MultiDocumenter package, followoing the build and deployment approach +# used in https://github.com/JuliaAstro/EphemerisSources.jl +# This script is executed after building the docs for each package +# See the pipeling in .github/workflows/multidocs.yml + using MultiDocumenter -for (root, dirs, files) in walkdir(".") - for file in files - filepath = joinpath(root, file) - if islink(filepath) - linktarget = abspath(dirname(filepath), readlink(filepath)) - rm(filepath) - cp(linktarget, filepath; force=true) - end - end +clonedir = mktempdir() + +function package(name; path = joinpath("docs", name), branch) + MultiDocumenter.MultiDocRef( + upstream = joinpath(clonedir, name), + path = path, + name = name, + branch = branch, + giturl = "https://github.com/JuliaGraphs/GraphNeuralNetworks.jl.git", + fix_canonical_url = false, + ) end docs = [ - MultiDocumenter.MultiDocRef( - upstream = joinpath(dirname(@__DIR__),"GraphNeuralNetworks", "docs", "build"), - path = "graphneuralnetworks", - name = "GraphNeuralNetworks.jl", - fix_canonical_url = false), - MultiDocumenter.MultiDocRef( - upstream = joinpath(dirname(@__DIR__), "GNNLux", "docs", "build"), - path = "gnnlux", - name = "GNNLux.jl", - fix_canonical_url = false), - MultiDocumenter.MultiDocRef( - upstream = joinpath(dirname(@__DIR__), "GNNGraphs", "docs", "build"), - path = "gnngraphs", - name = "GNNGraphs.jl", - fix_canonical_url = false), - MultiDocumenter.MultiDocRef( - upstream = joinpath(dirname(@__DIR__), "GNNlib", "docs", "build"), - path = "gnnlib", - name = "GNNlib.jl", - fix_canonical_url = false), + package("GraphNeuralNetworks.jl", branch = "docs-graphneuralnetworks"), + package("GNNLux", branch = "docs-gnnlux"), + package("GNNGraphs", branch = "docs-gnngraphs"), + package("GNNlib", branch = "docs-gnnlib"), ] outpath = joinpath(@__DIR__, "build") @@ -47,57 +38,8 @@ MultiDocumenter.make( rootpath = "/GraphNeuralNetworks.jl/" ) -cp(joinpath(@__DIR__, "logo.svg"), - joinpath(outpath, "logo.svg")) - -if !("PR" in ARGS) - @warn "Deploying to GitHub as MultiDocumenter" - gitroot = normpath(joinpath(@__DIR__, "..")) - run(`git pull`) - - outbranch = "dep-multidocs" - has_outbranch = true - - status_output = read(`git status --porcelain docs/Project.toml`, String) - if !isempty(status_output) - @info "Restoring docs/Project.toml due to changes." - run(`git restore docs/Project.toml`) - else - @info "No changes detected in docs/Project.toml." - end - - if !success(`git checkout -f $outbranch`) - has_outbranch = false - if !success(`git switch --orphan $outbranch`) - @error "Cannot create new orphaned branch $outbranch." - exit(1) - end - end - - @info "Cleaning up $gitroot." - for file in readdir(gitroot; join = true) - file == "/home/runner/work/GraphNeuralNetworks.jl/GraphNeuralNetworks.jl/docs" && continue - endswith(file, ".git") && continue - rm(file; force = true, recursive = true) - end - - @info "Copying aggregated documentation to $gitroot." - for file in readdir(outpath) - cp(joinpath(outpath, file), joinpath(gitroot, file)) - end - - rm("/home/runner/work/GraphNeuralNetworks.jl/GraphNeuralNetworks.jl/docs"; force = true, recursive = true) - - run(`git add .`) - if success(`git commit -m 'Aggregate documentation'`) - @info "Pushing updated documentation." - if has_outbranch - run(`git push`) - else - run(`git push -u origin $outbranch`) - end - run(`git checkout master`) - else - @info "No changes to aggregated documentation." - end -end \ No newline at end of file +Documenter.deploydocs( + target = outpath, + versions = nothing, + repo = "github.com/JuliaGraphs/GraphNeuralNetworks.jl", +)