|
1 | 1 | using Documenter |
2 | 2 | import Pkg |
3 | 3 | using HOHQMesh |
| 4 | +using Changelog: Changelog |
4 | 5 |
|
5 | 6 | # Define module-wide setups such that the respective modules are available in doctests |
6 | 7 | DocMeta.setdocmeta!(HOHQMesh, :DocTestSetup, :(using HOHQMesh); recursive=true) |
@@ -39,6 +40,24 @@ readme_text = replace(readme_text, |
39 | 40 | r"\[comment\].*\n" => "") # remove comments |
40 | 41 | write(joinpath(@__DIR__, "src", "index.md"), readme_text) |
41 | 42 |
|
| 43 | +# Create changelog |
| 44 | +Changelog.generate(Changelog.Documenter(), # output type |
| 45 | + joinpath(@__DIR__, "..", "NEWS.md"), # input file |
| 46 | + joinpath(@__DIR__, "src", "changelog_tmp.md"); # output file |
| 47 | + repo = "trixi-framework/HOHQMesh.jl", # default repository for links |
| 48 | + branch = "main",) |
| 49 | +# Fix edit URL of changelog |
| 50 | +open(joinpath(@__DIR__, "src", "changelog.md"), "w") do io |
| 51 | + for line in eachline(joinpath(@__DIR__, "src", "changelog_tmp.md")) |
| 52 | + if startswith(line, "EditURL") |
| 53 | + line = "EditURL = \"https://github.com/trixi-framework/HOHQMesh.jl/blob/main/NEWS.md\"" |
| 54 | + end |
| 55 | + println(io, line) |
| 56 | + end |
| 57 | +end |
| 58 | +# Remove temporary file |
| 59 | +rm(joinpath(@__DIR__, "src", "changelog_tmp.md")) |
| 60 | + |
42 | 61 | # Make documentation |
43 | 62 | makedocs(; |
44 | 63 | # Specify modules for which docstrings should be shown |
@@ -75,11 +94,12 @@ makedocs(; |
75 | 94 | "GitHub & Git" => "github-git.md", |
76 | 95 | "Testing" => "testing.md", |
77 | 96 | ], |
| 97 | + "Reference" => "reference.md", |
| 98 | + "Changelog" => "changelog.md", |
78 | 99 | "Authors" => "authors.md", |
79 | 100 | "Contributing" => "contributing.md", |
80 | 101 | "Code of Conduct" => "code_of_conduct.md", |
81 | | - "License" => "license.md", |
82 | | - "Reference" => "reference.md"]) |
| 102 | + "License" => "license.md"]) |
83 | 103 |
|
84 | 104 | deploydocs( |
85 | 105 | repo = "github.com/trixi-framework/HOHQMesh.jl", |
|
0 commit comments