From 76cc9188cca03c889e022e1eddda39da59f63f74 Mon Sep 17 00:00:00 2001 From: Huiyu Xie Date: Fri, 20 Sep 2024 08:06:01 -0400 Subject: [PATCH] Enable documentation for package (#50) * Start * Fix error --- .github/workflows/Documentation.yml | 29 +++++++++++++++++++++++++++++ .gitignore | 1 + .typos.toml | 2 +- docs/Project.toml | 5 +++++ docs/make.jl | 17 +++++++++++++++++ docs/{ => src}/aws_gpu_setup.md | 0 docs/{ => src}/dev_env_info.md | 0 docs/src/index.md | 1 + docs/{ => src}/nsys_profiling.md | 0 9 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/Documentation.yml create mode 100644 docs/Project.toml create mode 100644 docs/make.jl rename docs/{ => src}/aws_gpu_setup.md (100%) rename docs/{ => src}/dev_env_info.md (100%) create mode 100644 docs/src/index.md rename docs/{ => src}/nsys_profiling.md (100%) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml new file mode 100644 index 0000000..5591e22 --- /dev/null +++ b/.github/workflows/Documentation.yml @@ -0,0 +1,29 @@ +name: Documentation +on: + push: + branches: + - main # update to match your development branch (master, main, dev, trunk, ...) + tags: "*" + pull_request: + +jobs: + build: + 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" + - 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 }} # If authenticating with GitHub Actions token + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key + run: julia --project=docs/ docs/make.jl diff --git a/.gitignore b/.gitignore index 38d09c7..85b7a25 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ **/Manifest.toml out*/ +docs/build .DS_Store diff --git a/.typos.toml b/.typos.toml index e3e12b9..0840da3 100644 --- a/.typos.toml +++ b/.typos.toml @@ -1,4 +1,4 @@ [files] extend-exclude = [ - "docs/dev_env_info.md" + "docs/src/dev_env_info.md" ] diff --git a/docs/Project.toml b/docs/Project.toml new file mode 100644 index 0000000..31c4695 --- /dev/null +++ b/docs/Project.toml @@ -0,0 +1,5 @@ +[deps] +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" + +[extras] +Trixi = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb" diff --git a/docs/make.jl b/docs/make.jl new file mode 100644 index 0000000..a995649 --- /dev/null +++ b/docs/make.jl @@ -0,0 +1,17 @@ +# TrixiCUDA.jl is not accessible through Julia's LOAD_PATH currently +push!(LOAD_PATH, "../src/") + +using Documenter +using TrixiCUDA + +# DocMeta.setdocmeta!(TrixiCUDA, :DocTestSetup, :(using TrixiCUDA); recursive = true) + +makedocs(sitename = "TrixiCUDA.jl", + # pages = [ + # "Home" => "index.md" + # ], + format = Documenter.HTML(prettyurls = get(ENV, "CI", nothing) == "true")) + +deploydocs(repo = "github.com/trixi-gpu/TrixiCUDA.jl", + devbranch = "main", + push_preview = true) diff --git a/docs/aws_gpu_setup.md b/docs/src/aws_gpu_setup.md similarity index 100% rename from docs/aws_gpu_setup.md rename to docs/src/aws_gpu_setup.md diff --git a/docs/dev_env_info.md b/docs/src/dev_env_info.md similarity index 100% rename from docs/dev_env_info.md rename to docs/src/dev_env_info.md diff --git a/docs/src/index.md b/docs/src/index.md new file mode 100644 index 0000000..de91950 --- /dev/null +++ b/docs/src/index.md @@ -0,0 +1 @@ +# TrixiCUDA.jl \ No newline at end of file diff --git a/docs/nsys_profiling.md b/docs/src/nsys_profiling.md similarity index 100% rename from docs/nsys_profiling.md rename to docs/src/nsys_profiling.md