Skip to content

Commit

Permalink
Use Changelog.jl for changelog maintenance (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Apr 2, 2024
1 parent 0de74ea commit 38f393d
Show file tree
Hide file tree
Showing 7 changed files with 193 additions and 71 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.DS_Store
/docs/build/
/docs/site/
/docs/src/release-notes.md
Manifest.toml
187 changes: 125 additions & 62 deletions CHANGELOG.md

Large diffs are not rendered by default.

26 changes: 24 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
all: generate_badge generate_favicon
JULIA:=julia

.PHONY: all generate_badge generate_favicon
default: help

.PHONY: default changelog docs docs-instantiate generate_badge generate_favicon help test

docs-instantiate:
${JULIA} docs/instantiate.jl

changelog: docs-instantiate
${JULIA} --project=docs docs/changelog.jl

docs: docs-instantiate
${JULIA} --project=docs docs/make.jl

generate_badge:
SVG_BASE64=$(shell base64 -w 0 docs/src/assets/logo.svg); \
Expand All @@ -10,3 +21,14 @@ generate_favicon:
convert -background none docs/src/assets/logo.svg -resize 256x256 -gravity center -extent 256x256 logo.png
convert logo.png -define icon:auto-resize=256,64,48,32,16 docs/src/assets/favicon.ico
rm logo.png

test:
${JULIA} --project -e 'using Pkg; Pkg.test()'

help:
@echo "The following make commands are available:"
@echo " - make changelog: update all links in CHANGELOG.md's footer"
@echo " - make docs: build the documentation"
@echo " - make generate_badge: generate the Aqua.jl badge"
@echo " - make generate_favicon: generate the Aqua.jl favicon"
@echo " - make test: run the tests"
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[deps]
Changelog = "5217a498-cd5d-4ec6-b8c2-9b85a09b6e3e"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Changelog = "1"
Documenter = "1"
7 changes: 7 additions & 0 deletions docs/changelog.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Changelog

Changelog.generate(
Changelog.CommonMark(),
joinpath(@__DIR__, "..", "CHANGELOG.md");
repo = "JuliaTesting/Aqua.jl",
)
17 changes: 17 additions & 0 deletions docs/instantiate.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This script can be used to quickly instantiate the docs/Project.toml environment.
using Pkg, TOML

package_directory = joinpath(@__DIR__, "..")
docs_directory = isempty(ARGS) ? @__DIR__() : joinpath(pwd(), ARGS[1])
cd(docs_directory) do
Pkg.activate(docs_directory)
Pkg.develop(PackageSpec(path = package_directory))
Pkg.instantiate()

# Remove Aqua again from docs/Project.toml
project_toml = TOML.parsefile(joinpath(docs_directory, "Project.toml"))
delete!(project_toml["deps"], "Aqua")
open(joinpath(docs_directory, "Project.toml"), "w") do io
TOML.print(io, project_toml)
end
end
24 changes: 17 additions & 7 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
using Documenter, Aqua
using Documenter, Aqua, Changelog

# Generate a Documenter-friendly changelog from CHANGELOG.md
Changelog.generate(
Changelog.Documenter(),
joinpath(@__DIR__, "..", "CHANGELOG.md"),
joinpath(@__DIR__, "src", "release-notes.md");
repo = "JuliaTesting/Aqua.jl",
)

makedocs(;
sitename = "Aqua.jl",
format = Documenter.HTML(;
repolink = "https://github.com/JuliaTesting/Aqua.jl",
assets = ["assets/favicon.ico"],
size_threshold_ignore = ["release-notes.md"],
),
authors = "Takafumi Arakaki",
modules = [Aqua],
pages = [
"Home" => "index.md",
Expand All @@ -15,13 +30,8 @@ makedocs(;
"piracies.md",
"persistent_tasks.md",
],
"release-notes.md",
],
sitename = "Aqua.jl",
format = Documenter.HTML(;
repolink = "https://github.com/JuliaTesting/Aqua.jl",
assets = ["assets/favicon.ico"],
),
authors = "Takafumi Arakaki",
)

deploydocs(; repo = "github.com/JuliaTesting/Aqua.jl", push_preview = true)

0 comments on commit 38f393d

Please sign in to comment.