Skip to content

Commit fa898c6

Browse files
authored
Set up documentation (#46)
* Set up documentation * Remove rogue manifest * Add badges * Fix Documenter compat
1 parent 289ffbd commit fa898c6

File tree

11 files changed

+153
-8
lines changed

11 files changed

+153
-8
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Documentation
2+
3+
permissions:
4+
contents: write
5+
pages: write
6+
7+
on:
8+
push:
9+
branches:
10+
- 'master'
11+
- 'main'
12+
- 'release-'
13+
tags: '*'
14+
pull_request:
15+
16+
jobs:
17+
build:
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
matrix:
21+
version:
22+
- '1' # automatically expands to the latest stable 1.x release of Julia
23+
os:
24+
- ubuntu-latest
25+
arch:
26+
- x64
27+
steps:
28+
- uses: actions/checkout@v5
29+
- uses: julia-actions/setup-julia@latest
30+
with:
31+
version: ${{ matrix.version }}
32+
arch: ${{ matrix.arch }}
33+
- name: Install dependencies
34+
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
35+
- name: Build and deploy
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
38+
run: julia --project=docs/ docs/make.jl
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Documentation Preview Cleanup
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
# Ensure that only one "Doc Preview Cleanup" workflow is force pushing at a time
8+
concurrency:
9+
group: doc-preview-cleanup
10+
cancel-in-progress: false
11+
12+
jobs:
13+
doc-preview-cleanup:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
steps:
18+
- name: Checkout gh-pages branch
19+
uses: actions/checkout@v5
20+
with:
21+
ref: gh-pages
22+
- name: Delete preview and history + push changes
23+
run: |
24+
if [ -d "${preview_dir}" ]; then
25+
git config user.name "Documenter.jl"
26+
git config user.email "[email protected]"
27+
git rm -rf "${preview_dir}"
28+
git commit -m "delete preview"
29+
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
30+
git push --force origin gh-pages-new:gh-pages
31+
fi
32+
env:
33+
preview_dir: previews/PR${{ github.event.number }}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Documentation Preview Comment
2+
on:
3+
pull_request:
4+
types: [labeled]
5+
6+
permissions:
7+
pull-requests: write
8+
jobs:
9+
pr_comment:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Create PR comment
13+
if: github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name && github.event.label.name == 'documentation'
14+
uses: thollander/actions-comment-pull-request@v3
15+
with:
16+
message: 'After the build completes, the updated documentation will be available [here](https://quantumkithub.github.io/TensorKitSectors.jl/previews/PR${{ github.event.number }}/)'
17+
comment-tag: 'preview-doc'

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*.jl.*.cov
22
*.jl.cov
33
*.jl.mem
4-
/Manifest.toml
5-
.DS_Store
4+
Manifest.toml
5+
.DS_Store
6+
build

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22

33
A Julia package for working with objects in fusion categories.
44

5-
| **Build Status** | **PkgEval** | **Coverage** | **Quality assurance** |
6-
|:----------------:|:------------:|:------------:|:---------------------:|
7-
| [![CI][ci-img]][ci-url] | [![PkgEval][pkgeval-img]][pkgeval-url] | [![Codecov][codecov-img]][codecov-url] | [![Aqua QA][aqua-img]][aqua-url] |
5+
| **Documentation** | **Build Status** | **PkgEval** | **Coverage** | **Quality assurance** |
6+
|:-----------------:|:----------------:|:-----------:|:------------:|:---------------------:|
7+
| [![][docs-stable-img]][docs-stable-url] [![][docs-dev-img]][docs-dev-url] | [![CI][ci-img]][ci-url] | [![PkgEval][pkgeval-img]][pkgeval-url] | [![Codecov][codecov-img]][codecov-url] | [![Aqua QA][aqua-img]][aqua-url] |
8+
9+
[docs-stable-img]: https://img.shields.io/badge/docs-stable-blue.svg
10+
[docs-stable-url]: https://QuantumKitHub.github.io/TensorKitSectors.jl/stable
11+
12+
[docs-dev-img]: https://img.shields.io/badge/docs-dev-blue.svg
13+
[docs-dev-url]: https://QuantumKitHub.github.io/TensorKitSectors.jl/latest
814

915
[ci-img]: https://github.com/QuantumKitHub/TensorKitSectors.jl/actions/workflows/CI.yml/badge.svg
1016
[ci-url]: https://github.com/QuantumKitHub/TensorKitSectors.jl/actions/workflows/CI.yml

docs/Project.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[deps]
2+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
TensorKitSectors = "13a9c161-d5da-41f0-bcbd-e1a08ae0647f"
4+
5+
[compat]
6+
Documenter = "1"

docs/make.jl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using TensorKitSectors
2+
using Documenter
3+
4+
mathengine = MathJax3(
5+
Dict(
6+
:loader => Dict("load" => ["[tex]/physics"]),
7+
:tex => Dict(
8+
"inlineMath" => [["\$", "\$"], ["\\(", "\\)"]],
9+
"tags" => "ams",
10+
"packages" => ["base", "ams", "autoload", "physics"]
11+
)
12+
)
13+
)
14+
makedocs(;
15+
sitename = "TensorKitSectors.jl",
16+
format = Documenter.HTML(;
17+
prettyurls = true,
18+
mathengine,
19+
),
20+
pages = [
21+
"Home" => "index.md",
22+
"Library" => "lib.md",
23+
],
24+
checkdocs = :exports,
25+
)
26+
27+
deploydocs(; repo = "github.com/QuantumKitHub/TensorKitSectors.jl.git", push_preview = true)

docs/src/index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# TensorKitSectors.jl
2+
3+
A Julia package for working with objects in fusion categories.
4+
5+
This package provides functionality for defining objects in fusion categories, along with
6+
their topological data. This includes the fusion rules, the associators, and the braiding.
7+
In particular, this is the data that is needed to define (symmetric) tensors, which are
8+
defined over vector spaces graded by these objects. For the full functionality, we refer to
9+
[TensorKit.jl](https://github.com/QuantumKitHub/TensorKit.jl) and [its
10+
documentation](https://quantumkithub.github.io/TensorKit.jl/stable/).
11+
12+
Install via the package manager.

docs/src/lib.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Library documentation
2+
3+
```@autodocs
4+
Modules = [TensorKitSectors]
5+
```

src/irreps/znirrep.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const SMALL_ZN_CUTOFF = (typemax(UInt8) + 1) ÷ 2
77
Irrep[ℤ{N}](n::Integer)
88
99
Represents irreps of the group ``ℤ_N`` for some value of `N`.
10-
For `N` equals `2`, `3` or `4`, `ℤ{N}` can be replaced by [`ℤ₂`](@ref), [`ℤ₃`](@ref), and [`ℤ₄`](@ref).
10+
For `N` equals `2`, `3` or `4`, `ℤ{N}` can be replaced by `ℤ₂`, `ℤ₃`, and `ℤ₄`.
1111
An arbitrary `Integer` `n` can be provided to the constructor, but only the value `mod(n, N)` is relevant.
1212
1313
The type of the stored integer (`UInt8`) requires `N ≤ $SMALL_ZN_CUTOFF`.
@@ -33,7 +33,7 @@ end
3333
Irrep[ℤ{N}](n::Integer)
3434
3535
Represents irreps of the group ``ℤ_N`` for some value of `N`, which is typically larger than $SMALL_ZN_CUTOFF.
36-
For smaller values of `N`, the [`ZNIrrep}`](@ref) sector type should be used instead.
36+
For smaller values of `N`, the [`ZNIrrep`](@ref) sector type should be used instead.
3737
An arbitrary `Integer` `n` can be provided to the constructor, but only the value `mod(n, N)` is relevant.
3838
3939
The constructor `Irrep[ℤ{N}]` should be preferred, as it will automatically select the most efficient storage type for a given value of `N`.

0 commit comments

Comments
 (0)