Skip to content

Commit 4eb55f2

Browse files
authored
[docs] tidy release notes (#2055)
1 parent 874e7be commit 4eb55f2

File tree

3 files changed

+190
-291
lines changed

3 files changed

+190
-291
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ docs/site/
88
test/Benchmarks/*.json
99
Manifest.toml
1010
*.swp
11+
docs/src/release_notes.md

docs/make.jl

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,35 @@ const _PAGES = [
8686
"Release notes" => "release_notes.md",
8787
]
8888

89+
# ==============================================================================
90+
# Modify the release notes
91+
# ==============================================================================
92+
93+
function fix_release_line(
94+
line::String,
95+
url::String = "https://github.com/jump-dev/MathOptInterface.jl"
96+
)
97+
# (#XXXX) -> ([#XXXX](url/issue/XXXX))
98+
while (m = match(r"\(\#([0-9]+)\)", line)) !== nothing
99+
id = m.captures[1]
100+
line = replace(line, m.match => "([#$id]($url/issues/$id))")
101+
end
102+
# ## vX.Y.Z -> [vX.Y.Z](url/releases/tag/vX.Y.Z)
103+
while (m = match(r"\#\# (v[0-9]+.[0-9]+.[0-9]+)", line)) !== nothing
104+
tag = m.captures[1]
105+
line = replace(line, m.match => "## [$tag]($url/releases/tag/$tag)")
106+
end
107+
return line
108+
end
109+
110+
open(joinpath(@__DIR__, "src", "changelog.md"), "r") do in_io
111+
open(joinpath(@__DIR__, "src", "release_notes.md"), "w") do out_io
112+
for line in readlines(in_io; keep = true)
113+
write(out_io, fix_release_line(line))
114+
end
115+
end
116+
end
117+
89118
# ==============================================================================
90119
# Build the HTML docs
91120
# ==============================================================================

0 commit comments

Comments
 (0)