|
1 | 1 | using Documenter |
2 | 2 | using DocumenterInterLinks |
| 3 | +using TrixiAtmo |
3 | 4 |
|
4 | 5 | # Fix for https://github.com/trixi-framework/Trixi.jl/issues/668 |
5 | 6 | if (get(ENV, "CI", nothing) != "true") && |
6 | 7 | (get(ENV, "TRIXI_DOC_DEFAULT_ENVIRONMENT", nothing) != "true") |
7 | 8 | push!(LOAD_PATH, dirname(@__DIR__)) |
8 | 9 | end |
9 | 10 |
|
10 | | -using TrixiAtmo |
| 11 | +# Define module-wide setups such that the respective modules are available in doctests |
| 12 | +DocMeta.setdocmeta!(TrixiAtmo, :DocTestSetup, :(using TrixiAtmo); |
| 13 | + recursive = true) |
11 | 14 |
|
12 | 15 | # Provide external links to the Trixi.jl docs (project root and inventory file) |
13 | 16 | links = InterLinks("Trixi" => ("https://trixi-framework.github.io/Trixi.jl/stable/", |
14 | 17 | "https://trixi-framework.github.io/Trixi.jl/stable/objects.inv")) |
15 | 18 |
|
16 | | -DocMeta.setdocmeta!(TrixiAtmo, :DocTestSetup, :(using TrixiAtmo); |
17 | | - recursive = true) |
| 19 | +# Copy list of authors to not need to synchronize it manually. |
| 20 | +# Since the authors header exists twice we create a unique identifier for the docs section. |
| 21 | +authors_text = read(joinpath(dirname(@__DIR__), "AUTHORS.md"), String) |
| 22 | +authors_text = replace(authors_text, |
| 23 | + "[LICENSE.md](LICENSE.md)" => "[License](@ref)", |
| 24 | + "# Authors" => "# [Authors](@id trixi_atmo_authors)") |
| 25 | +write(joinpath(@__DIR__, "src", "authors.md"), authors_text) |
| 26 | + |
| 27 | +# Copy contributing information to not need to synchronize it manually |
| 28 | +contributing_text = read(joinpath(dirname(@__DIR__), "CONTRIBUTING.md"), String) |
| 29 | +contributing_text = replace(contributing_text, |
| 30 | + "[LICENSE.md](LICENSE.md)" => "[License](@ref)", |
| 31 | + "[AUTHORS.md](AUTHORS.md)" => "[Authors](@ref trixi_atmo_authors)") |
| 32 | +write(joinpath(@__DIR__, "src", "contributing.md"), contributing_text) |
| 33 | + |
| 34 | +# Copy code of conduct to not need to synchronize it manually |
| 35 | +code_of_conduct_text = read(joinpath(dirname(@__DIR__), "CODE_OF_CONDUCT.md"), String) |
| 36 | +code_of_conduct_text = replace(code_of_conduct_text, |
| 37 | + "[AUTHORS.md](AUTHORS.md)" => "[Authors](@ref trixi_atmo_authors)") |
| 38 | +write(joinpath(@__DIR__, "src", "code_of_conduct.md"), code_of_conduct_text) |
| 39 | + |
| 40 | +# Copy contents form README to the starting page to not need to synchronize it manually |
| 41 | +readme_text = read(joinpath(dirname(@__DIR__), "README.md"), String) |
| 42 | +readme_text = replace(readme_text, |
| 43 | + "[LICENSE.md](LICENSE.md)" => "[License](@ref)", |
| 44 | + "[AUTHORS.md](AUTHORS.md)" => "[Authors](@ref trixi_atmo_authors)", |
| 45 | + "<p" => "```@raw html\n<p", |
| 46 | + "p>" => "p>\n```", |
| 47 | + r"\[comment\].*\n" => "") # remove comments |
| 48 | +write(joinpath(@__DIR__, "src", "home.md"), readme_text) |
18 | 49 |
|
19 | 50 | makedocs(; |
20 | 51 | modules = [TrixiAtmo], |
21 | | - authors = "Benedict Geihe <bgeihe@uni-koeln.de>, Tristan Montoya <montoya.tristan@gmail.com, Hendrik Ranocha <hendrik.ranocha@uni-mainz.de>, Michael Schlottke-Lakemper <michael@sloede.com>", |
| 52 | + authors = "Benedict Geihe <bgeihe@uni-koeln.de>, Tristan Montoya <montoya.tristan@gmail.com, Hendrik Ranocha <hendrik.ranocha@uni-mainz.de>, Andrés Rueda-Ramírez <am.rueda@upm.es>, Michael Schlottke-Lakemper <michael@sloede.com>", |
22 | 53 | repo = Remotes.GitHub("trixi-framework", "TrixiAtmo.jl"), |
23 | 54 | sitename = "TrixiAtmo.jl", |
24 | 55 | format = Documenter.HTML(; |
25 | 56 | prettyurls = get(ENV, "CI", "false") == "true", |
26 | 57 | canonical = "https://trixi-framework.github.io/TrixiAtmo.jl", |
27 | 58 | edit_link = "main", |
28 | 59 | assets = String[],), |
29 | | - pages = ["Home" => "index.md"], |
| 60 | + pages = ["Home" => "index.md", |
| 61 | + "Reference" => "reference.md", |
| 62 | + "Authors" => "authors.md", |
| 63 | + "Contributing" => "contributing.md", |
| 64 | + "Code of Conduct" => "code_of_conduct.md", |
| 65 | + "License" => "license.md"], |
30 | 66 | plugins = [links],) |
31 | 67 |
|
32 | 68 | deploydocs(; |
|
0 commit comments