Skip to content

Commit 132b2c8

Browse files
committed
extend docs
mostly parsing files in root folder
1 parent 7aec844 commit 132b2c8

File tree

2 files changed

+50
-5
lines changed

2 files changed

+50
-5
lines changed

docs/make.jl

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,68 @@
11
using Documenter
22
using DocumenterInterLinks
3+
using TrixiAtmo
34

45
# Fix for https://github.com/trixi-framework/Trixi.jl/issues/668
56
if (get(ENV, "CI", nothing) != "true") &&
67
(get(ENV, "TRIXI_DOC_DEFAULT_ENVIRONMENT", nothing) != "true")
78
push!(LOAD_PATH, dirname(@__DIR__))
89
end
910

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)
1114

1215
# Provide external links to the Trixi.jl docs (project root and inventory file)
1316
links = InterLinks("Trixi" => ("https://trixi-framework.github.io/Trixi.jl/stable/",
1417
"https://trixi-framework.github.io/Trixi.jl/stable/objects.inv"))
1518

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)
1849

1950
makedocs(;
2051
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>",
2253
repo = Remotes.GitHub("trixi-framework", "TrixiAtmo.jl"),
2354
sitename = "TrixiAtmo.jl",
2455
format = Documenter.HTML(;
2556
prettyurls = get(ENV, "CI", "false") == "true",
2657
canonical = "https://trixi-framework.github.io/TrixiAtmo.jl",
2758
edit_link = "main",
2859
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"],
3066
plugins = [links],)
3167

3268
deploydocs(;

docs/src/reference.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
```@meta
2+
CurrentModule = TrixiAtmo
3+
```
4+
5+
# TrixiAtmo.jl API
6+
7+
```@autodocs
8+
Modules = [TrixiAtmo]
9+
```

0 commit comments

Comments
 (0)