Skip to content

Commit 732b953

Browse files
committed
a stub of documentation
1 parent 47135bb commit 732b953

9 files changed

Lines changed: 1189 additions & 0 deletions

File tree

.github/workflows/documenter.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Documenter
2+
on:
3+
push:
4+
branches: [main]
5+
tags: [v*]
6+
pull_request:
7+
8+
jobs:
9+
docs:
10+
name: Documentation
11+
runs-on: ubuntu-latest
12+
if: contains( github.event.pull_request.labels.*.name, 'preview docs') || github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/')
13+
steps:
14+
- uses: actions/checkout@v6
15+
- uses: julia-actions/setup-julia@latest
16+
with:
17+
version: "1.12"
18+
- name: Julia Cache
19+
uses: julia-actions/cache@v3
20+
- name: "Documenter rendering"
21+
run: "docs/make.jl"
22+
env:
23+
PYTHON: ""
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
26+
note:
27+
name: "Documentation deployment note."
28+
runs-on: ubuntu-latest
29+
if: "!contains( github.event.pull_request.labels.*.name, 'preview docs')"
30+
steps:
31+
- name: echo instructions
32+
run: echo 'The Documentation is only generated and pushed on a PR if the “preview docs” label is added.'

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
11
/Manifest*.toml
2+
3+
Manifest.toml
4+
docs/Manifest.toml
5+
docs/build
6+
docs/src/generated
7+
docs/src/misc/contributing.md
8+
docs/src/misc/CONTRIBUTING.md
9+
docs/src/misc/NEWS.md
10+
benchmark/tune.json
11+
benchmark/results*
12+
docs/src/tutorials/*.md
13+
coverage
14+
*.cov
15+
tutorials/_freeze
16+
accuracy/*_files
17+
accuracy/_freeze
18+
accuracy/.quarto
19+
docs/src/tutorials/hand-gestures_files/figure-commonmark
20+
docs/src/tutorials/work-with-a-metric-defined-in-a-chart_files
21+
docs/.CondaPkg

docs/Project.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[deps]
2+
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
3+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
4+
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
5+
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
6+
Manifolds = "1cead3c2-87b3-11e9-0ccd-23c62b72b94e"
7+
ManifoldsBase = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb"
8+
ManifoldsGPU = "007d1224-8888-47ee-87d0-87e096ff9b5b"
9+
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
10+
PythonPlot = "274fc56d-3b97-40fa-a1cd-1b4a50311bf9"
11+
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
12+
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
13+
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
14+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
15+
16+
[compat]
17+
Colors = "0.13"
18+
Documenter = "1"
19+
DocumenterCitations = "1.3"
20+
DocumenterInterLinks = "1"
21+
Manifolds = "0.11"
22+
ManifoldsBase = "2"
23+
ManifoldsGPU = "0.1"
24+
Plots = "1"
25+
PythonPlot = "1"
26+
RecipesBase = "1"
27+
RecursiveArrayTools = "3"
28+
StaticArrays = "1.0"
29+
30+
[sources]
31+
ManifoldsGPU = {path = ".."}

docs/make.jl

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#!/usr/bin/env julia
2+
#
3+
#
4+
5+
using Pkg
6+
using Plots, RecipesBase, Manifolds, ManifoldsBase, Documenter, PythonPlot
7+
using ManifoldsGPU
8+
using DocumenterCitations, DocumenterInterLinks
9+
# required for loading methods that handle differential equation solving
10+
# required for loading the manifold tests functions
11+
using Test
12+
ENV["GKSwstype"] = "100"
13+
14+
# (e) add CONTRIBUTING.md and NEWS.md to docs
15+
16+
function add_links(line::String, url::String = "https://github.com/JuliaManifolds/ManifoldsGPU.jl")
17+
# replace issues (#XXXX) -> ([#XXXX](url/issue/XXXX))
18+
while (m = match(r"\(\#([0-9]+)\)", line)) !== nothing
19+
id = m.captures[1]
20+
line = replace(line, m.match => "([#$id]($url/issues/$id))")
21+
end
22+
# replace ## [X.Y.Z] -> with a link to the release [X.Y.Z](url/releases/tag/vX.Y.Z)
23+
while (m = match(r"\#\# \[([0-9]+.[0-9]+.[0-9]+)\] (.*)", line)) !== nothing
24+
tag = m.captures[1]
25+
date = m.captures[2]
26+
line = replace(line, m.match => "## [$tag]($url/releases/tag/v$tag) ($date)")
27+
end
28+
return line
29+
end
30+
31+
generated_path = joinpath(@__DIR__, "src", "misc")
32+
base_url = "https://github.com/JuliaManifolds/ManifoldsGPU.jl/blob/main/"
33+
isdir(generated_path) || mkdir(generated_path)
34+
for fname in ["NEWS.md"]
35+
open(joinpath(generated_path, fname), "w") do io
36+
# Point to source license file
37+
println(
38+
io,
39+
"""
40+
```@meta
41+
EditURL = "$(base_url)$(fname)"
42+
```
43+
""",
44+
)
45+
# Write the contents out below the meta block
46+
for line in eachline(joinpath(dirname(@__DIR__), fname))
47+
println(io, add_links(line))
48+
end
49+
end
50+
end
51+
52+
# (f) final step: render the docs
53+
bib = CitationBibliography(joinpath(@__DIR__, "src", "references.bib"); style = :alpha)
54+
links = InterLinks(
55+
"ManifoldsBase" => ("https://juliamanifolds.github.io/ManifoldsBase.jl/stable/"),
56+
"Manifolds" => ("https://juliamanifolds.github.io/Manifolds.jl/stable/"),
57+
)
58+
59+
# We'd like to build docs on CI, so we can't load the CUDA extension
60+
# The rendered docs need to be in the main module
61+
modules = [
62+
ManifoldsGPU,
63+
]
64+
65+
if modules isa Vector{Union{Nothing, Module}}
66+
error("At least one module has not been properly loaded: ", modules)
67+
end
68+
69+
makedocs(;
70+
format = Documenter.HTML(
71+
prettyurls = (get(ENV, "CI", nothing) == "true") || ("--prettyurls" ARGS),
72+
assets = ["assets/favicon.ico", "assets/citations.css", "assets/link-icons.css"],
73+
search_size_threshold_warn = 1000 * 2^10, # raise slightly from 500 to 1 MiB
74+
size_threshold_warn = 200 * 2^10, # raise slightly from 100 to 200 KiB
75+
size_threshold = 300 * 2^10, # raise slightly 200 to 300 KiB
76+
),
77+
modules = modules,
78+
authors = "Mateusz Baran, Shiwen An, and contributors.",
79+
sitename = "ManifoldsGPU.jl",
80+
pages = [
81+
"Home" => "index.md",
82+
"Miscellanea" => [
83+
"Changelog" => "misc/NEWS.md",
84+
"Internals" => "misc/internals.md",
85+
"References" => "misc/references.md",
86+
],
87+
],
88+
plugins = [bib, links],
89+
)
90+
deploydocs(repo = "github.com/JuliaManifolds/ManifoldsGPU.jl.git", push_preview = true)
91+
#back to main env
92+
Pkg.activate()

docs/src/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ManifoldsGPU
2+
3+
```@docs
4+
ManifoldsGPU.ManifoldsGPU
5+
```

docs/src/misc/internals.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Internal documentation
2+
3+
This page documents the internal types and methods of `ManifoldsGPU.jl`.

docs/src/misc/references.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Literature
2+
3+
We are slowly moving to using [`DocumenterCitations.jl`](https://github.com/JuliaDocs/DocumenterCitations.jl/).
4+
The goal is to have all references used / mentioned in the documentation of Manifolds.jl also listed here.
5+
If you notice a reference still defined in a footnote, please change it into a BibTeX reference and [open a PR](https://github.com/JuliaManifolds/Manifolds.jl/compare)
6+
7+
Usually you will find a small reference section at the end of every documentation page that contains references for just that page.
8+
9+
```@bibliography
10+
```

0 commit comments

Comments
 (0)