Skip to content

Commit 59d5905

Browse files
committed
import changelog into docs as well.
1 parent 958d418 commit 59d5905

8 files changed

Lines changed: 72 additions & 7 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
docs/build
22
docs/Manifest.toml
33
Manifest.toml
4+
docs/src/changelog.md

docs/make.jl

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,62 @@ if "--help" ∈ ARGS
1717
exit(0)
1818
end
1919

20-
using Pkg
21-
Pkg.activate(@__DIR__)
22-
Pkg.develop(PackageSpec(; path = (@__DIR__) * "/../"))
23-
Pkg.resolve()
24-
Pkg.instantiate()
20+
# if docs is not the current active environment, switch to it
21+
# (from https://github.com/JuliaIO/HDF5.jl/pull/1020/) 
22+
if Base.active_project() != joinpath(@__DIR__, "Project.toml")
23+
using Pkg
24+
Pkg.activate(@__DIR__)
25+
Pkg.instantiate()
26+
end
2527

28+
#
29+
# Load packages
2630
using Documenter, DocumenterCitations, DocumenterInterLinks
2731
using AlgorithmsInterface
2832

2933
run_on_CI = (get(ENV, "CI", nothing) == "true")
3034

35+
#
36+
# Copy and reformat changelog
37+
38+
# (d) add contributing.md and changelog.md to the docs – and link to releases and issues
39+
40+
function add_links(line::String, url::String = "https://github.com/JuliaManifolds/Manopt.jl")
41+
# replace issues (#XXXX) -> ([#XXXX](url/issue/XXXX))
42+
while (m = match(r"\(\#([0-9]+)\)", line)) !== nothing
43+
id = m.captures[1]
44+
line = replace(line, m.match => "([#$id]($url/issues/$id))")
45+
end
46+
# replace ## [X.Y.Z] -> with a link to the release [X.Y.Z](url/releases/tag/vX.Y.Z)
47+
while (m = match(r"\#\# \[([0-9]+.[0-9]+.[0-9]+)\] (.*)", line)) !== nothing
48+
tag = m.captures[1]
49+
date = m.captures[2]
50+
line = replace(line, m.match => "## [$tag]($url/releases/tag/v$tag) ($date)")
51+
end
52+
return line
53+
end
54+
55+
generated_path = joinpath(@__DIR__, "src")
56+
base_url = "https://github.com/JuliaManifolds/Manopt.jl/blob/master/"
57+
isdir(generated_path) || mkdir(generated_path)
58+
for (md_file, doc_file) in [("Changelog.md", "changelog.md"), ]
59+
open(joinpath(generated_path, doc_file), "w") do io
60+
# Point to source license file
61+
println(
62+
io,
63+
"""
64+
```@meta
65+
EditURL = "$(base_url)$(md_file)"
66+
```
67+
""",
68+
)
69+
# Write the contents out below the meta block
70+
for line in eachline(joinpath(dirname(@__DIR__), md_file))
71+
println(io, add_links(line))
72+
end
73+
end
74+
end
75+
3176
bib = CitationBibliography(joinpath(@__DIR__, "src", "references.bib"); style = :alpha)
3277
links = InterLinks()
3378
makedocs(;
@@ -47,8 +92,12 @@ makedocs(;
4792
"Interface" => "interface.md",
4893
"Stopping criteria" => "stopping_criterion.md",
4994
"Logging" => "logging.md",
50-
"Notation" => "notation.md",
51-
"References" => "references.md",
95+
"Miscellanea" => [
96+
"Internals" => "internals.md",
97+
"Notation" => "notation.md",
98+
"Changelog" => "changelog.md",
99+
"References" => "references.md",
100+
],
52101
],
53102
expandfirst = ["interface.md", "stopping_criterion.md"],
54103
plugins = [bib, links],

docs/src/assets/logo-text-dark.png

-116 KB
Binary file not shown.
-57.8 KB
Binary file not shown.
-51.7 KB
Binary file not shown.

docs/src/assets/logo-text.png

-99.5 KB
Binary file not shown.

docs/src/internals.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Internals
2+
3+
## Test
4+
5+
```@docs
6+
AlgorithmsInterface.Test
7+
```
8+
9+
```@autodocs
10+
Modules = [AlgorithmsInterface]
11+
Pages = ["test_suite.jl"]
12+
Order = [:type, :function]
13+
Private = true
14+
Public = true
15+
```

0 commit comments

Comments
 (0)