-
Notifications
You must be signed in to change notification settings - Fork 5
Set up documentation #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,38 @@ | ||
| name: Documentation | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pages: write | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - 'master' | ||
| - 'main' | ||
| - 'release-' | ||
| tags: '*' | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| version: | ||
| - '1' # automatically expands to the latest stable 1.x release of Julia | ||
| os: | ||
| - ubuntu-latest | ||
| arch: | ||
| - x64 | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: julia-actions/setup-julia@latest | ||
| with: | ||
| version: ${{ matrix.version }} | ||
| arch: ${{ matrix.arch }} | ||
| - 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 }} # For authentication with GitHub Actions token | ||
| run: julia --project=docs/ docs/make.jl |
This file contains hidden or 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,33 @@ | ||
| name: Documentation Preview Cleanup | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [closed] | ||
|
|
||
| # Ensure that only one "Doc Preview Cleanup" workflow is force pushing at a time | ||
| concurrency: | ||
| group: doc-preview-cleanup | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| doc-preview-cleanup: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Checkout gh-pages branch | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| ref: gh-pages | ||
| - name: Delete preview and history + push changes | ||
| run: | | ||
| if [ -d "${preview_dir}" ]; then | ||
| git config user.name "Documenter.jl" | ||
| git config user.email "[email protected]" | ||
| git rm -rf "${preview_dir}" | ||
| git commit -m "delete preview" | ||
| git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) | ||
| git push --force origin gh-pages-new:gh-pages | ||
| fi | ||
| env: | ||
| preview_dir: previews/PR${{ github.event.number }} | ||
This file contains hidden or 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,17 @@ | ||
| name: Documentation Preview Comment | ||
| on: | ||
| pull_request: | ||
| types: [labeled] | ||
|
|
||
| permissions: | ||
| pull-requests: write | ||
| jobs: | ||
| pr_comment: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Create PR comment | ||
| if: github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name && github.event.label.name == 'documentation' | ||
| uses: thollander/actions-comment-pull-request@v3 | ||
| with: | ||
| message: 'After the build completes, the updated documentation will be available [here](https://quantumkithub.github.io/TensorKitSectors.jl/previews/PR${{ github.event.number }}/)' | ||
| comment-tag: 'preview-doc' |
This file contains hidden or 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,6 @@ | ||
| *.jl.*.cov | ||
| *.jl.cov | ||
| *.jl.mem | ||
| /Manifest.toml | ||
| .DS_Store | ||
| Manifest.toml | ||
| .DS_Store | ||
| build |
This file contains hidden or 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 hidden or 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,6 @@ | ||
| [deps] | ||
| Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
| TensorKitSectors = "13a9c161-d5da-41f0-bcbd-e1a08ae0647f" | ||
|
|
||
| [compat] | ||
| Documenter = "1" |
This file contains hidden or 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,27 @@ | ||
| using TensorKitSectors | ||
| using Documenter | ||
|
|
||
| mathengine = MathJax3( | ||
| Dict( | ||
| :loader => Dict("load" => ["[tex]/physics"]), | ||
| :tex => Dict( | ||
| "inlineMath" => [["\$", "\$"], ["\\(", "\\)"]], | ||
| "tags" => "ams", | ||
| "packages" => ["base", "ams", "autoload", "physics"] | ||
| ) | ||
| ) | ||
| ) | ||
| makedocs(; | ||
| sitename = "TensorKitSectors.jl", | ||
| format = Documenter.HTML(; | ||
| prettyurls = true, | ||
| mathengine, | ||
| ), | ||
| pages = [ | ||
| "Home" => "index.md", | ||
| "Library" => "lib.md", | ||
| ], | ||
| checkdocs = :exports, | ||
| ) | ||
|
|
||
| deploydocs(; repo = "github.com/QuantumKitHub/TensorKitSectors.jl.git", push_preview = true) |
This file contains hidden or 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,12 @@ | ||
| # TensorKitSectors.jl | ||
|
|
||
| A Julia package for working with objects in fusion categories. | ||
|
|
||
| This package provides functionality for defining objects in fusion categories, along with | ||
| their topological data. This includes the fusion rules, the associators, and the braiding. | ||
| In particular, this is the data that is needed to define (symmetric) tensors, which are | ||
| defined over vector spaces graded by these objects. For the full functionality, we refer to | ||
| [TensorKit.jl](https://github.com/QuantumKitHub/TensorKit.jl) and [its | ||
| documentation](https://quantumkithub.github.io/TensorKit.jl/stable/). | ||
|
|
||
| Install via the package manager. |
This file contains hidden or 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 @@ | ||
| # Library documentation | ||
|
|
||
| ```@autodocs | ||
| Modules = [TensorKitSectors] | ||
| ``` |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never seen this workflow before. Is this something standard now? Where did you find this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have it in MPSKit.jl and PEPSKit.jl. It deletes the documentation preview for a PR that is pushed to the
gh-pagesbranch if you runDocumenter.deploydocswithpush_preview = true. Just so the files don't pile up there if you have many PRs I think.