-
Notifications
You must be signed in to change notification settings - Fork 16
Documentation Template Refactor #213
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
13 commits
Select commit
Hold shift + click to select a range
5a1c267
Integrating docs from PQO
gennadiryan df12863
Docs revamp staging
gennadiryan 3e4bb69
add docs touches
jack-champagne 095c849
update readme for docs building instructions
jack-champagne 0d190a4
testing caching, simplifying docs/project.toml
jack-champagne a4fa3d7
use PiccoloDocsTemplate instead of utils.jl
jack-champagne e540902
Update docs.yml
gennadiryan 4bc78f2
use PiccoloDocsTemplate instead of utils.jl
jack-champagne f6d5258
Docs overhaul
gennadiryan b15c330
servedocs calls can't have empty vecs
jack-champagne 6377dc2
Fixing docs dependencies (removing spurious Project.toml; adding plot…
gennadiryan c74a7af
Merge remote-tracking branch 'origin/feature/docs-revamp' into featur…
gennadiryan 3024417
More Project.toml file fixes
gennadiryan 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
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,45 @@ | ||
| name: Documentation | ||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
| tags: ['*'] | ||
| 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: | ||
| docs: | ||
| name: Documentation | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| statuses: write | ||
| env: | ||
| DOC_TEMPLATE_VERSION: "v0.2.1" # Change this to the specific tag version you want | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: julia-actions/setup-julia@v2 | ||
| - uses: julia-actions/cache@v2 | ||
| - name: Use Documentation Template | ||
| run: | | ||
| ./docs/get_docs_utils.sh ${{ env.DOC_TEMPLATE_VERSION }} | ||
| - uses: julia-actions/julia-buildpkg@v1 | ||
| - uses: julia-actions/julia-docdeploy@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Upload documentation artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: documentation-build | ||
| path: docs/build/ | ||
| retention-days: 1 | ||
| - run: | | ||
| julia --project=docs -e ' | ||
| using Documenter: DocMeta, doctest | ||
| using QuantumCollocation | ||
| DocMeta.setdocmeta!(QuantumCollocation, :DocTestSetup, :(using QuantumCollocation); recursive=true) | ||
| doctest(QuantumCollocation)' | ||
|
|
This file was deleted.
Oops, something went wrong.
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
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,38 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| # Get the directory where this script is located | ||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| PROJECT_ROOT="$SCRIPT_DIR/.." | ||
|
|
||
| # if argument is provided, use it as the DOC_TEMPLATE_VERSION | ||
| if [[ $# -gt 0 ]]; then | ||
| DOC_TEMPLATE_VERSION="$1" | ||
| else | ||
| WORKFLOW_FILE="$PROJECT_ROOT/.github/workflows/docs.yml" | ||
|
|
||
| # Check if workflow file exists | ||
| if [[ ! -f "$WORKFLOW_FILE" ]]; then | ||
| echo "GitHub workflow file not found at: $WORKFLOW_FILE" | ||
| exit 1 | ||
| fi | ||
|
|
||
| DOC_TEMPLATE_VERSION=$(grep -E '^\s*DOC_TEMPLATE_VERSION:' "$WORKFLOW_FILE" | sed -E 's/.*DOC_TEMPLATE_VERSION:\s*"([^"]+)".*/\1/') | ||
| fi | ||
|
|
||
| if [[ -z "$DOC_TEMPLATE_VERSION" ]]; then | ||
| echo "DOC_TEMPLATE_VERSION is not set" | ||
| echo "Please provide a version tag as an arg or ensure it is set in $WORKFLOW_FILE" | ||
| echo "Could not extract DOC_TEMPLATE_VERSION from $WORKFLOW_FILE" | ||
| echo "Expected format: DOC_TEMPLATE_VERSION: \"<version tag here>\"" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Clone the repository | ||
| echo "Grabbing PiccoloDocsTemplate at version $DOC_TEMPLATE_VERSION" | ||
| julia --project="$PROJECT_ROOT/docs" -e " | ||
| using Pkg; Pkg.add(url=\"https://github.com/harmoniqs/PiccoloDocsTemplate.jl\", rev=\"$DOC_TEMPLATE_VERSION\") | ||
| " | ||
|
|
||
| echo "Successfully updated PiccoloDocsTemplate with version $DOC_TEMPLATE_VERSION" |
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,66 +1,25 @@ | ||
| using QuantumCollocation | ||
| using Documenter | ||
| using Literate | ||
|
|
||
| push!(LOAD_PATH, joinpath(@__DIR__, "..", "src")) | ||
|
|
||
| @info "Building Documenter site for QuantumCollocation.jl" | ||
| using PiccoloDocsTemplate | ||
|
|
||
| pages = [ | ||
| "Home" => "index.md", | ||
| "Manual" => [ | ||
| "Ket Problem Templates" => "generated/man/ket_problem_templates.md", | ||
| "Unitary Problem Templates" => "generated/man/unitary_problem_templates.md", | ||
| ], | ||
| "Examples" => [ | ||
| "Two Qubit Gates" => "generated/examples/two_qubit_gates.md", | ||
| "Multilevel Transmon" => "generated/examples/multilevel_transmon.md", | ||
| ], | ||
| "Library" => [ | ||
| "Ket Problem Templates" => "generated/man/ket_problem_templates.md", | ||
| "Unitary Problem Templates" => "generated/man/unitary_problem_templates.md", | ||
| ], | ||
| "Library" => "lib.md", | ||
| ] | ||
|
|
||
| format = Documenter.HTML(; | ||
| prettyurls=get(ENV, "CI", "false") == "true", | ||
| canonical="https://docs.harmoniqs.co/QuantumCollocation.jl", | ||
| edit_link="main", | ||
| assets=String[], | ||
| mathengine = MathJax3(Dict( | ||
| :loader => Dict("load" => ["[tex]/physics"]), | ||
| :tex => Dict( | ||
| "inlineMath" => [["\$","\$"], ["\\(","\\)"]], | ||
| "tags" => "ams", | ||
| "packages" => [ | ||
| "base", | ||
| "ams", | ||
| "autoload", | ||
| "physics" | ||
| ], | ||
| ), | ||
| )), | ||
| # size_threshold=4_000_000, | ||
| ) | ||
|
|
||
| src = joinpath(@__DIR__, "src") | ||
| lit = joinpath(@__DIR__, "literate") | ||
|
|
||
| lit_output = joinpath(src, "generated") | ||
|
|
||
| for (root, _, files) ∈ walkdir(lit), file ∈ files | ||
| splitext(file)[2] == ".jl" || continue | ||
| ipath = joinpath(root, file) | ||
| opath = splitdir(replace(ipath, lit=>lit_output))[1] | ||
| Literate.markdown(ipath, opath) | ||
| end | ||
|
|
||
| makedocs(; | ||
| modules=[QuantumCollocation], | ||
| authors="Aaron Trowbridge <aaron.j.trowbridge@gmail.com> and contributors", | ||
| sitename="QuantumCollocation.jl", | ||
| format=format, | ||
| pages=pages, | ||
| warnonly=true, | ||
| ) | ||
|
|
||
| deploydocs(; | ||
| repo="github.com/harmoniqs/QuantumCollocation.jl.git", | ||
| devbranch="main", | ||
| ) | ||
| generate_docs( | ||
| @__DIR__, | ||
| "QuantumCollocation", | ||
| [QuantumCollocation], | ||
| pages; | ||
| make_index = false, | ||
| make_assets = false, | ||
| format_kwargs = (canonical = "https://docs.harmoniqs.co/QuantumCollocation.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
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
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
Oops, something went wrong.
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.
See #214, can leave as is for now