Skip to content

Commit 062bd41

Browse files
committed
Doc and tests overhaul
1 parent 71cf31d commit 062bd41

24 files changed

+564
-549
lines changed

Diff for: .JuliaFormatter.toml

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
always_for_in = true
2-
whitespace_typedefs = true
3-
whitespace_ops_in_indices = true
4-
remove_extra_newlines = true
5-
import_to_using = true
6-
short_to_long_function_def = true
1+
style = "blue"

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Manifest.toml
22
docs/build/
33
.vscode/settings.json
4+
docs/src/tutorial

Diff for: Project.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "MetaGraphsNext"
22
uuid = "fa8bd995-216d-47f1-8a91-f3b68fbeb377"
3-
version = "0.4.0"
3+
version = "0.4.1"
44

55
[deps]
66
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
@@ -12,8 +12,10 @@ JLD2 = "0.1.11, 0.2, 0.3, 0.4"
1212
julia = "1.6"
1313

1414
[extras]
15+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
1516
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
17+
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
1618
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1719

1820
[targets]
19-
test = ["Documenter", "Test"]
21+
test = ["Aqua", "Documenter", "JuliaFormatter", "Test"]

Diff for: README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# MetaGraphsNext
1+
# MetaGraphsNext.jl
22

33
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaGraphs.github.io/MetaGraphsNext.jl/dev)
44
[![Build Status](https://github.com/JuliaGraphs/MetaGraphsNext.jl/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/JuliaGraphs/MetaGraphsNext.jl/actions/workflows/test.yml?query=branch%3Amaster)
55
[![CodeCov](https://codecov.io/gh/JuliaGraphs/MetaGraphsNext.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaGraphs/MetaGraphsNext.jl)
66

7-
Welcome to MetaGraphsNext, an experimental, type-stable replacement for [MetaGraphs](https://github.com/JuliaGraphs/MetaGraphs.jl). This package will let you store metadata on the vertices and edges of your graphs. Take a look at the [documentation](https://juliagraphs.org/MetaGraphsNext.jl/dev/) to learn more!
7+
Welcome to MetaGraphsNext.jl, a type-stable replacement for [MetaGraphs.jl](https://github.com/JuliaGraphs/MetaGraphs.jl). It allows you to create graphs with vertex and edge metadata, on which you can unleash the full power of the [Graphs.jl](https://github.com/JuliaGraphs/Graphs.jl) ecosystem.
8+
9+
Take a look at the [documentation](https://juliagraphs.org/MetaGraphsNext.jl/dev/) to learn more!

Diff for: docs/Project.toml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
33
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
4+
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
5+
MetaGraphsNext = "fa8bd995-216d-47f1-8a91-f3b68fbeb377"

Diff for: docs/make.jl

+53-19
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,58 @@
1-
using Documenter: deploydocs, HTML, makedocs
1+
using Documenter
2+
using Literate
23
using MetaGraphsNext
34

4-
makedocs(
5-
sitename = "MetaGraphsNext.jl",
6-
modules = [MetaGraphsNext],
7-
doctest = true,
8-
format = HTML(;
9-
prettyurls = get(ENV, "CI", "false") == "true",
10-
canonical = "https://juliagraphs.org/MetaGraphsNext.jl/dev/",
11-
assets = String[],
12-
),
13-
pages = [
14-
"Home" => "index.md",
15-
"Tutorial" => [
16-
"Basics" => "tutorial_basics.md",
17-
"Graphs.jl interface" => "tutorial_graphs.md",
18-
"Reading / writing" => "tutorial_files.md",
19-
],
20-
"API reference" => "api.md",
5+
DocMeta.setdocmeta!(MetaGraphsNext, :DocTestSetup, :(using MetaGraphsNext); recursive=true)
6+
7+
TUTORIAL_DIR_JL = joinpath(dirname(@__DIR__), "test", "tutorial")
8+
TUTORIAL_DIR_MD = joinpath(@__DIR__, "src", "tutorial")
9+
10+
for file in readdir(TUTORIAL_DIR_MD)
11+
rm(joinpath(TUTORIAL_DIR_MD, file))
12+
end
13+
14+
for file in readdir(TUTORIAL_DIR_JL)
15+
Literate.markdown(
16+
joinpath(TUTORIAL_DIR_JL, file),
17+
TUTORIAL_DIR_MD;
18+
documenter=true,
19+
flavor=Literate.DocumenterFlavor(),
20+
)
21+
end
22+
23+
function markdown_title(path)
24+
title = "?"
25+
open(path, "r") do file
26+
for line in eachline(file)
27+
if startswith(line, '#')
28+
title = strip(line, [' ', '#'])
29+
break
30+
end
31+
end
32+
end
33+
return String(title)
34+
end
35+
36+
pages = [
37+
"Home" => "index.md",
38+
"Tutorial" => [
39+
markdown_title(joinpath(TUTORIAL_DIR_MD, file)) => joinpath("tutorial", file)
40+
for file in sort(readdir(TUTORIAL_DIR_MD))
2141
],
42+
"API reference" => "api.md",
43+
]
44+
45+
makedocs(;
46+
sitename="MetaGraphsNext.jl",
47+
modules=[MetaGraphsNext],
48+
doctest=true,
49+
pages=pages,
50+
format=Documenter.HTML(;
51+
prettyurls=get(ENV, "CI", "false") == "true",
52+
canonical="https://juliagraphs.org/MetaGraphsNext.jl/dev/",
53+
assets=String[],
54+
edit_link=:commit,
55+
),
2256
)
2357

24-
deploydocs(repo = "github.com/JuliaGraphs/MetaGraphsNext.jl.git")
58+
deploydocs(; repo="github.com/JuliaGraphs/MetaGraphsNext.jl.git")

Diff for: docs/src/api.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,20 @@
66
Modules = [MetaGraphsNext]
77
```
88

9+
```@docs
10+
haskey
11+
getindex
12+
setindex!
13+
delete!
14+
```
15+
16+
```@docs
17+
add_vertex!
18+
add_edge!
19+
weights
20+
```
21+
922
## Index
1023

1124
```@index
12-
Modules = [MetaGraphsNext]
13-
```
25+
```

Diff for: docs/src/index.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MetaGraphsNext.jl
22

3-
Welcome to `MetaGraphsNext.jl`, an experimental, type-stable replacement for [MetaGraphs](https://github.com/JuliaGraphs/MetaGraphs.jl).
3+
Welcome to MetaGraphsNext.jl, a type-stable replacement for [MetaGraphs.jl](https://github.com/JuliaGraphs/MetaGraphs.jl). It allows you to create graphs with vertex and edge metadata, on which you can unleash the full power of the [Graphs.jl](https://github.com/JuliaGraphs/Graphs.jl) ecosystem.
44

55
## Getting started
66

@@ -9,5 +9,3 @@ To install the package, open the Julia REPL and type
99
```julia
1010
julia> using Pkg; Pkg.add("MetaGraphsNext")
1111
```
12-
13-
The tutorial provides an overview of the functionalities. We first explain the [basics](tutorial_basics.md) of the `MetaGraph` structure, before moving on to its [integration](tutorial_graphs.md) with `Graphs.jl`.

Diff for: docs/src/tutorial_basics.md

-143
This file was deleted.

Diff for: docs/src/tutorial_files.md

-60
This file was deleted.

0 commit comments

Comments
 (0)