Skip to content

Commit 53ca5fc

Browse files
Merge pull request #172 from CarloLucibello/cl/tutorials
add Pluto tutorials
2 parents ec6951f + a95178a commit 53ca5fc

15 files changed

+4179
-11
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Flux = "0.13"
3333
Functors = "0.2"
3434
Graphs = "1.4"
3535
KrylovKit = "0.5"
36+
MLDatasets = "0.6, 0.7"
3637
MLUtils = "0.2.3"
3738
MacroTools = "0.5"
3839
NNlib = "0.8"

docs/Project.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,11 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
33
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
44
GraphNeuralNetworks = "cffab07f-9bc2-4db1-8861-388f63bf7694"
55
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
6+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
7+
MarkdownLiteral = "736d6165-7244-6769-4267-6b50796e6954"
68
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
9+
Pluto = "c3e4b0f8-55cb-11ea-2926-15256bba5781"
10+
PlutoStaticHTML = "359b1769-a58e-495b-9770-312e911026ad"
11+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
712
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
13+
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

docs/make.jl

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,97 @@
11
using Flux, NNlib, GraphNeuralNetworks, Graphs, SparseArrays
22
using Documenter
33

4+
# See this for a template of Pluto+Documenter
5+
# https://github.com/rikhuijzer/PlutoStaticHTML.jl/blob/main/docs/make.jl
6+
using Pluto, PlutoStaticHTML
7+
using Documenter: MathJax3
8+
9+
tutorial_menu = Array{Pair{String,String},1}()
10+
11+
#
12+
# Generate Pluto Tutorial HTMLs
13+
14+
# pluto_src_folder = joinpath(@__DIR__, "src", "tutorials")
15+
# pluto_output_folder = joinpath(@__DIR__, "src", "tutorials")
16+
# pluto_relative_path = "tutorials/"
17+
# mkpath(pluto_output_folder)
18+
19+
# """
20+
# build()
21+
# Run all Pluto notebooks (".jl" files) in `NOTEBOOK_DIR`.
22+
# """
23+
# function build()
24+
# println("Building notebooks")
25+
# hopts = HTMLOptions(; append_build_context=true)
26+
# output_format = documenter_output
27+
# bopts = BuildOptions(pluto_src_folder; output_format)
28+
# build_notebooks(bopts, hopts)
29+
# return nothing
30+
# end
31+
32+
# # Build the notebooks; defaults to true.
33+
# if get(ENV, "BUILD_DOCS_NOTEBOOKS", "true") == "true"
34+
# build()
35+
# end
36+
37+
# # Please do not use the same name as for a(n old) literate Tutorial
38+
# pluto_files = [
39+
# "gnn_intro_pluto",
40+
# "graph_classification_pluto",
41+
# ]
42+
# pluto_titles = [
43+
# "Intro to Graph Neural Networks ",
44+
# "Graph Classification",
45+
# ]
46+
47+
# # build menu and write files myself - tp set edit url correctly.
48+
# for (title, file) in zip(pluto_titles, pluto_files)
49+
# global tutorial_menu
50+
# rendered = build_notebooks( #though not really parallel here
51+
# BuildOptions(
52+
# pluto_src_folder;
53+
# output_format=documenter_output,
54+
# write_files=false,
55+
# use_distributed=false,
56+
# ),
57+
# ["$(file).jl"],
58+
# )
59+
# write(
60+
# joinpath(pluto_output_folder, file * ".md"),
61+
# """
62+
# ```@meta
63+
# EditURL = "$(joinpath(pluto_src_folder, file * ".jl"))"
64+
# ```
65+
# $(rendered[1])
66+
# """,
67+
# )
68+
# push!(tutorial_menu, title => joinpath(pluto_relative_path, file * ".md"))
69+
# end
70+
471
DocMeta.setdocmeta!(GraphNeuralNetworks, :DocTestSetup,
572
:(using GraphNeuralNetworks, Graphs, SparseArrays, NNlib, Flux);
673
recursive=true)
774

75+
prettyurls = get(ENV, "CI", nothing) == "true"
76+
mathengine = MathJax3()
77+
878
makedocs(;
9-
modules=[GraphNeuralNetworks, NNlib, Flux, Graphs, SparseArrays],
10-
doctest=false, clean=true,
79+
modules = [GraphNeuralNetworks, NNlib, Flux, Graphs, SparseArrays],
80+
doctest = false,
81+
clean = true,
82+
format= Documenter.HTML(; mathengine, prettyurls),
1183
sitename = "GraphNeuralNetworks.jl",
1284
pages = ["Home" => "index.md",
1385
"Graphs" => "gnngraph.md",
1486
"Message Passing" => "messagepassing.md",
1587
"Model Building" => "models.md",
1688
"Datasets" => "datasets.md",
89+
# "Tutorials" => tutorial_menu,
90+
# "Tutorials" =>
91+
# [
92+
# "Intro to Graph Neural Networks" => "gnn_intro_pluto.md",
93+
# "Graph Classification" => "graph_classification_pluto.md",
94+
# ],
1795
"API Reference" =>
1896
[
1997
"GNNGraph" => "api/gnngraph.md",

docs/src/datasets.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
GraphNeuralNetworks.jl doesn't come with its own datasets, but leverages those available in the Julia (and non-Julia) ecosystem. In particular, the [examples in the GraphNeuralNetworks.jl repository](https://github.com/CarloLucibello/GraphNeuralNetworks.jl/tree/master/examples) make use of the [MLDatasets.jl](https://github.com/JuliaML/MLDatasets.jl) package. There you will find common graph datasets such as Cora, PubMed, Citeseer, TUDataset and [many others](https://juliaml.github.io/MLDatasets.jl/dev/datasets/graphs/).
44

5-
GraphNeuralNetworks.jl provides the [`mldatasets2gnngraph`](@ref) method for interfacing with MLDatasets.jl.
5+
GraphNeuralNetworks.jl provides the [`mldataset2gnngraph`](@ref) method for interfacing with MLDatasets.jl.
66

77
```@docs
8-
mldatasets2gnngraph
8+
mldataset2gnngraph
99
```

0 commit comments

Comments
 (0)