-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add basic Documenter workflow * renamed to LICENSE.md * Readme updates * Make header unique * assign different id to license section in doc/index.md * small additions * Revert "assign different id to license section in doc/index.md" This reverts commit 74de7a7. * typo --------- Co-authored-by: Benedict Geihe <bgeihe@uni-koeln.de>
- Loading branch information
Showing
8 changed files
with
169 additions
and
12 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,46 @@ | ||
name: Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: '*' | ||
paths-ignore: | ||
- '.github/workflows/ci.yml' | ||
- '.github/workflows/CompatHelper.yml' | ||
- '.github/workflows/TagBot.yml' | ||
pull_request: | ||
paths-ignore: | ||
- '.github/workflows/ci.yml' | ||
- '.github/workflows/CompatHelper.yml' | ||
- '.github/workflows/TagBot.yml' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
# Skip intermediate builds: always. | ||
# Cancel intermediate builds: only if it is a pull request build. | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | ||
|
||
jobs: | ||
build-docs: | ||
permissions: | ||
actions: write | ||
contents: write | ||
pull-requests: read | ||
statuses: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@v2 | ||
with: | ||
version: '1' | ||
show-versioninfo: true | ||
- uses: julia-actions/cache@v2 | ||
- name: Install dependencies | ||
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' | ||
- name: Build and deploy | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key | ||
run: julia --project=docs --color=yes docs/make.jl |
File renamed without changes.
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
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 ParaViewCatalyst.jl root directory | ||
paraviewcatalyst_root_dir = dirname(@__DIR__) | ||
|
||
# Fix for https://github.com/trixi-framework/Trixi.jl/issues/668 | ||
if (get(ENV, "CI", nothing) != "true") && (get(ENV, "PARAVIEWCATALYST_DOC_DEFAULT_ENVIRONMENT", nothing) != "true") | ||
push!(LOAD_PATH, paraviewcatalyst_root_dir) | ||
end | ||
|
||
using ParaViewCatalyst | ||
|
||
# Define module-wide setups such that the respective modules are available in doctests | ||
DocMeta.setdocmeta!(ParaViewCatalyst, :DocTestSetup, :(using ParaViewCatalyst); 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/ParaViewCatalyst.jl/blob/main/README.md" | ||
``` | ||
""") | ||
# Write the modified contents | ||
for line in eachline(joinpath(paraviewcatalyst_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/ParaViewCatalyst.jl/blob/main/LICENSE.md" | ||
``` | ||
""") | ||
# Write the modified contents | ||
println(io, "# License") | ||
println(io, "") | ||
for line in eachline(joinpath(paraviewcatalyst_root_dir, "LICENSE.md")) | ||
println(io, "> ", line) | ||
end | ||
end | ||
|
||
# Make documentation | ||
makedocs( | ||
# Specify modules for which docstrings should be shown | ||
modules = [ParaViewCatalyst], | ||
# Set sitename to Trixi.jl | ||
sitename="ParaViewCatalyst.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/ParaViewCatalyst.jl/stable" | ||
), | ||
# Explicitly specify documentation structure | ||
pages = [ | ||
"Home" => "index.md", | ||
"API reference" => "reference.md", | ||
"License" => "license.md" | ||
], | ||
) | ||
|
||
|
||
deploydocs(; | ||
repo = "github.com/trixi-framework/ParaViewCatalyst.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 = ParaViewCatalyst | ||
``` | ||
|
||
```@autodocs | ||
Modules = [ParaViewCatalyst] | ||
``` |