Skip to content

Commit 03b1290

Browse files
author
Uwe Hernandez Acosta
committed
use readme as landing page
1 parent 62d7f8a commit 03b1290

File tree

3 files changed

+44
-21
lines changed

3 files changed

+44
-21
lines changed

docs/make.jl

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,47 @@ DocMeta.setdocmeta!(
1212
LorentzVectorBase, :DocTestSetup, :(using LorentzVectorBase); recursive=true
1313
)
1414

15+
# some paths for links
16+
readme_path = joinpath(project_path, "README.md")
17+
index_path = joinpath(project_path, "docs/src/index.md")
18+
license_path = "https://github.com/QEDjl-project/QEDcore.jl/blob/main/LICENSE"
19+
20+
# Copy README.md from the project base folder and use it as the start page
21+
open(readme_path, "r") do readme_in
22+
readme_string = read(readme_in, String)
23+
24+
# replace relative links in the README.md
25+
readme_string = replace(readme_string, "[MIT](LICENSE)" => "[MIT]($(license_path))")
26+
27+
open(index_path, "w") do readme_out
28+
write(readme_out, readme_string)
29+
end
30+
end
31+
1532
pages = [
1633
"Home" => "index.md", "Interface" => "10-interface.md", "Reference" => "95-reference.md"
1734
]
1835

19-
makedocs(;
20-
modules=[LorentzVectorBase],
21-
authors="Uwe Hernandez Acosta <[email protected]>",
22-
repo=Documenter.Remotes.GitHub("JuliaHEP", "LorentzVectorBase.jl"),
23-
sitename="LorentzVectorBase.jl",
24-
format=Documenter.HTML(;
25-
prettyurls=get(ENV, "CI", "false") == "true",
26-
canonical="https://JuliaHEP.github.io/LorentzVectorBase.jl",
27-
# repolink="https://github.com/JuliaHEP/LorentzVectorBase.jl",
28-
# edit_link="main",
29-
assets=String[],
30-
),
31-
pages=pages,
32-
)
36+
try
37+
makedocs(;
38+
modules=[LorentzVectorBase],
39+
authors="Uwe Hernandez Acosta <[email protected]>",
40+
repo=Documenter.Remotes.GitHub("JuliaHEP", "LorentzVectorBase.jl"),
41+
sitename="LorentzVectorBase.jl",
42+
format=Documenter.HTML(;
43+
prettyurls=get(ENV, "CI", "false") == "true",
44+
canonical="https://JuliaHEP.github.io/LorentzVectorBase.jl",
45+
# repolink="https://github.com/JuliaHEP/LorentzVectorBase.jl",
46+
# edit_link="main",
47+
assets=String[],
48+
),
49+
pages=pages,
50+
)
51+
52+
finally
53+
# doing some garbage collection
54+
@info "GarbageCollection: remove generated landing page"
55+
rm(index_path)
56+
end
3357

3458
deploydocs(; repo="github.com/JuliaHEP/LorentzVectorBase.jl", push_preview=true)

docs/src/95-reference.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,9 @@ PtEtaPhiM
6262
plus_component
6363
minus_component
6464
```
65+
66+
## Utility
67+
68+
```@docs
69+
available_accessors
70+
```

docs/src/index.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)