Skip to content

Commit f59d3ec

Browse files
port tutorials from Literate to plain Documenter (#602)
* remove literate * democards + example block * fix * cleanup
1 parent b85f098 commit f59d3ec

31 files changed

+3594
-8663
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ GraphNeuralNetworks/docs/build
1818
GraphNeuralNetworks/docs/src/GNNGraphs
1919
GraphNeuralNetworks/docs/src/GNNlib
2020
tutorials/docs/build
21+
docs/src/tutorials # generated by DemoCards from docs/tutorials/
2122
prova.jl
2223
pyg.ipynb

GraphNeuralNetworks/docs/Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
[deps]
22
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
33
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
4+
DemoCards = "311a05b2-6137-4a5a-b473-18580a3d38b5"
45
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
56
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
7+
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
68
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
79
GNNGraphs = "aed8fd31-079b-4b5a-b342-a13352159b8c"
810
GNNlib = "a6a84749-d869-43f8-aacc-be26a1996e48"
@@ -14,8 +16,6 @@ Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
1416
MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458"
1517
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
1618
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
17-
PlutoStaticHTML = "359b1769-a58e-495b-9770-312e911026ad"
18-
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
1919
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
2020
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2121
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

GraphNeuralNetworks/docs/make.jl

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Pkg.develop([
88
Pkg.instantiate()
99

1010
using Documenter
11+
using DemoCards: DemoCards
1112
using GraphNeuralNetworks
1213
using Flux, GNNGraphs, GNNlib, Graphs
1314
using DocumenterInterLinks
@@ -39,14 +40,25 @@ cp(joinpath(@__DIR__, "../../GNNGraphs/docs/src"),
3940
cp(joinpath(@__DIR__, "../../GNNlib/docs/src"),
4041
joinpath(@__DIR__, "src/GNNlib"), force=true)
4142

43+
44+
## DEMO CARDS AUTOMATICALLY DETECTS TUTORIALS FROM FOLDER STRUCTURE
45+
tutorials, tutorials_postprocess_cb, tutorials_assets = DemoCards.makedemos(joinpath(@__DIR__, "tutorials"))
46+
## UNCOMMENT TO DISABLE TUTORIALS AND SPEED UP DOCS BUILDING
47+
# tutorials, tutorials_postprocess_cb, tutorials_assets =
48+
# "Tutorials" => "index.md", () -> nothing, nothing
49+
50+
assets = []
51+
isnothing(tutorials_assets) || push!(assets, tutorials_assets)
52+
4253
makedocs(;
4354
modules = [GraphNeuralNetworks, GNNGraphs, GNNlib],
4455
plugins = [interlinks],
4556
format = Documenter.HTML(; mathengine,
4657
prettyurls = get(ENV, "CI", nothing) == "true",
47-
assets = [],
58+
assets,
4859
size_threshold=nothing,
49-
size_threshold_warn=2000000),
60+
size_threshold_warn=2000000,
61+
example_size_threshold=2000000),
5062
sitename = "GraphNeuralNetworks.jl",
5163
pages = [
5264

@@ -60,19 +72,7 @@ makedocs(;
6072
"Heterogeneous Graphs" => "GNNGraphs/guides/heterograph.md",
6173
"Temporal Graphs" => "GNNGraphs/guides/temporalgraph.md",
6274
],
63-
64-
"Tutorials" => [
65-
"Introductory tutorials" => [
66-
"Hands on" => "tutorials/gnn_intro.md",
67-
"Node classification" => "tutorials/node_classification.md",
68-
"Graph classification" => "tutorials/graph_classification.md"
69-
],
70-
"Temporal graph neural networks" =>[
71-
"Node autoregression" => "tutorials/traffic_prediction.md",
72-
"Temporal graph classification" => "tutorials/temporal_graph_classification.md"
73-
],
74-
],
75-
75+
tutorials,
7676
"API Reference" => [
7777
"Graphs (GNNGraphs.jl)" => [
7878
"GNNGraph" => "GNNGraphs/api/gnngraph.md",
@@ -99,6 +99,7 @@ makedocs(;
9999
],
100100
)
101101

102+
tutorials_postprocess_cb()
102103
rm(joinpath(@__DIR__, "src/GNNGraphs"), force=true, recursive=true)
103104
rm(joinpath(@__DIR__, "src/GNNlib"), force=true, recursive=true)
104105

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
.grid-card-section {
2+
display: flex;
3+
flex-direction: row;
4+
flex-wrap: wrap;
5+
align-content: space-between;
6+
}
7+
8+
.grid-card:hover{
9+
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4), 0 6px 20px 0 rgba(0, 0, 0, 0.1);
10+
}
11+
12+
.grid-card {
13+
width: 210px;
14+
max-height: 400px;
15+
margin: 10px 15px;
16+
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
17+
transition: 0.3s;
18+
border-radius: 5px;
19+
}
20+
21+
.grid-card-text {
22+
padding: 0 15px;
23+
}
24+
25+
.grid-card-cover img {
26+
width: 100%;
27+
}
28+
29+
.grid-card-cover {
30+
width: 200px;
31+
height: 220px;
32+
padding: 5px;
33+
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
34+
transition: 0.3s;
35+
border-radius: 5px;
36+
display:block;
37+
margin:auto;
38+
}
39+
40+
.grid-card-cover .grid-card-description {
41+
opacity: 0;
42+
z-index: -1;
43+
position: absolute;
44+
top: 25%;
45+
left: 140%;
46+
width: 100%;
47+
transform: translate(-50%, -50%);
48+
padding: 10px;
49+
border-radius: 5px;
50+
background: rgba(0, 0, 0, 0.8);
51+
color: #fff;
52+
text-align: center;
53+
font-size: 14px;
54+
}
55+
56+
.grid-card-cover:hover .grid-card-description{
57+
z-index: 3;
58+
opacity: 1;
59+
}

GraphNeuralNetworks/docs/src/tutorials/gnn_intro.md

Lines changed: 0 additions & 390 deletions
This file was deleted.

0 commit comments

Comments
 (0)