-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[deps] | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
|
||
[compat] | ||
Documenter = "1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
using Documenter | ||
|
||
# Get TrixiBase.jl root directory | ||
trixibase_root_dir = dirname(@__DIR__) | ||
|
||
# Fix for https://github.com/trixi-framework/Trixi.jl/issues/668 | ||
if (get(ENV, "CI", nothing) != "true") && (get(ENV, "TRIXIBASE_DOC_DEFAULT_ENVIRONMENT", nothing) != "true") | ||
push!(LOAD_PATH, trixibase_root_dir) | ||
end | ||
|
||
using TrixiBase | ||
|
||
# Define module-wide setups such that the respective modules are available in doctests | ||
DocMeta.setdocmeta!(TrixiBase, :DocTestSetup, :(using TrixiBase); recursive=true) | ||
|
||
# Copy some files from the top level directory to the docs and modify them | ||
# as necessary | ||
open(joinpath(@__DIR__, "src", "index.md"), "w") do io | ||
# Point to source file | ||
println(io, """ | ||
```@meta | ||
EditURL = "https://github.com/trixi-framework/TrixiBase.jl/blob/main/README.md" | ||
``` | ||
""") | ||
# Write the modified contents | ||
for line in eachline(joinpath(trixibase_root_dir, "README.md")) | ||
line = replace(line, "[LICENSE.md](LICENSE.md)" => "[License](@ref)") | ||
println(io, line) | ||
end | ||
end | ||
|
||
# open(joinpath(@__DIR__, "src", "license.md"), "w") do io | ||
# # Point to source file | ||
# println(io, """ | ||
# ```@meta | ||
# EditURL = "https://github.com/trixi-framework/TrixiBase.jl/blob/main/LICENSE.md" | ||
# ``` | ||
# """) | ||
# # Write the modified contents | ||
# println(io, "# License") | ||
# println(io, "") | ||
# for line in eachline(joinpath(trixibase_root_dir, "LICENSE.md")) | ||
# println(io, "> ", line) | ||
# end | ||
# end | ||
|
||
# Make documentation | ||
makedocs( | ||
# Specify modules for which docstrings should be shown | ||
modules = [TrixiBase], | ||
# Set sitename to Trixi.jl | ||
sitename="TrixiBase.jl", | ||
# Provide additional formatting options | ||
format = Documenter.HTML( | ||
# Disable pretty URLs during manual testing | ||
prettyurls = get(ENV, "CI", nothing) == "true", | ||
# Set canonical URL to GitHub pages URL | ||
canonical = "https://trixi-framework.github.io/TrixiBase.jl/stable" | ||
), | ||
# Explicitly specify documentation structure | ||
pages = [ | ||
"Home" => "index.md", | ||
"API reference" => "reference.md", | ||
# "License" => "license.md" | ||
], | ||
) | ||
|
||
|
||
deploydocs(; | ||
repo = "github.com/trixi-framework/TrixiBase.jl", | ||
devbranch = "main", | ||
push_preview = true | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
index.md | ||
license.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# API reference | ||
|
||
```@meta | ||
CurrentModule = TrixiBase | ||
``` | ||
|
||
```@autodocs | ||
Modules = [TrixiBase] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
module TrixiBase | ||
|
||
""" | ||
greet() | ||
Please, welcome everyone! | ||
""" | ||
greet() = print("Hello World!") | ||
|
||
end # module TrixiBase |