Skip to content

port tutorials from Literate to plain Documenter #602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 17, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ GraphNeuralNetworks/docs/build
GraphNeuralNetworks/docs/src/GNNGraphs
GraphNeuralNetworks/docs/src/GNNlib
tutorials/docs/build
docs/src/tutorials # generated by DemoCards from docs/tutorials/
prova.jl
pyg.ipynb
4 changes: 2 additions & 2 deletions GraphNeuralNetworks/docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[deps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
DemoCards = "311a05b2-6137-4a5a-b473-18580a3d38b5"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
GNNGraphs = "aed8fd31-079b-4b5a-b342-a13352159b8c"
GNNlib = "a6a84749-d869-43f8-aacc-be26a1996e48"
Expand All @@ -14,8 +16,6 @@ Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458"
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PlutoStaticHTML = "359b1769-a58e-495b-9770-312e911026ad"
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Expand Down
31 changes: 16 additions & 15 deletions GraphNeuralNetworks/docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Pkg.develop([
Pkg.instantiate()

using Documenter
using DemoCards: DemoCards
using GraphNeuralNetworks
using Flux, GNNGraphs, GNNlib, Graphs
using DocumenterInterLinks
Expand Down Expand Up @@ -39,14 +40,25 @@ cp(joinpath(@__DIR__, "../../GNNGraphs/docs/src"),
cp(joinpath(@__DIR__, "../../GNNlib/docs/src"),
joinpath(@__DIR__, "src/GNNlib"), force=true)


## DEMO CARDS AUTOMATICALLY DETECTS TUTORIALS FROM FOLDER STRUCTURE
tutorials, tutorials_postprocess_cb, tutorials_assets = DemoCards.makedemos(joinpath(@__DIR__, "tutorials"))
## UNCOMMENT TO DISABLE TUTORIALS AND SPEED UP DOCS BUILDING
# tutorials, tutorials_postprocess_cb, tutorials_assets =
# "Tutorials" => "index.md", () -> nothing, nothing

assets = []
isnothing(tutorials_assets) || push!(assets, tutorials_assets)

makedocs(;
modules = [GraphNeuralNetworks, GNNGraphs, GNNlib],
plugins = [interlinks],
format = Documenter.HTML(; mathengine,
prettyurls = get(ENV, "CI", nothing) == "true",
assets = [],
assets,
size_threshold=nothing,
size_threshold_warn=2000000),
size_threshold_warn=2000000,
example_size_threshold=2000000),
sitename = "GraphNeuralNetworks.jl",
pages = [

Expand All @@ -60,19 +72,7 @@ makedocs(;
"Heterogeneous Graphs" => "GNNGraphs/guides/heterograph.md",
"Temporal Graphs" => "GNNGraphs/guides/temporalgraph.md",
],

"Tutorials" => [
"Introductory tutorials" => [
"Hands on" => "tutorials/gnn_intro.md",
"Node classification" => "tutorials/node_classification.md",
"Graph classification" => "tutorials/graph_classification.md"
],
"Temporal graph neural networks" =>[
"Node autoregression" => "tutorials/traffic_prediction.md",
"Temporal graph classification" => "tutorials/temporal_graph_classification.md"
],
],

tutorials,
"API Reference" => [
"Graphs (GNNGraphs.jl)" => [
"GNNGraph" => "GNNGraphs/api/gnngraph.md",
Expand All @@ -99,6 +99,7 @@ makedocs(;
],
)

tutorials_postprocess_cb()
rm(joinpath(@__DIR__, "src/GNNGraphs"), force=true, recursive=true)
rm(joinpath(@__DIR__, "src/GNNlib"), force=true, recursive=true)

Expand Down
59 changes: 59 additions & 0 deletions GraphNeuralNetworks/docs/src/democards/gridtheme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.grid-card-section {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-content: space-between;
}

.grid-card:hover{
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4), 0 6px 20px 0 rgba(0, 0, 0, 0.1);
}

.grid-card {
width: 210px;
max-height: 400px;
margin: 10px 15px;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
transition: 0.3s;
border-radius: 5px;
}

.grid-card-text {
padding: 0 15px;
}

.grid-card-cover img {
width: 100%;
}

.grid-card-cover {
width: 200px;
height: 220px;
padding: 5px;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
transition: 0.3s;
border-radius: 5px;
display:block;
margin:auto;
}

.grid-card-cover .grid-card-description {
opacity: 0;
z-index: -1;
position: absolute;
top: 25%;
left: 140%;
width: 100%;
transform: translate(-50%, -50%);
padding: 10px;
border-radius: 5px;
background: rgba(0, 0, 0, 0.8);
color: #fff;
text-align: center;
font-size: 14px;
}

.grid-card-cover:hover .grid-card-description{
z-index: 3;
opacity: 1;
}
390 changes: 0 additions & 390 deletions GraphNeuralNetworks/docs/src/tutorials/gnn_intro.md

This file was deleted.

Loading
Loading