diff --git a/.github/workflows/doc_preview_cleanup.yml b/.github/workflows/doc_preview_cleanup.yml new file mode 100644 index 0000000..bc29462 --- /dev/null +++ b/.github/workflows/doc_preview_cleanup.yml @@ -0,0 +1,26 @@ +name: Doc Preview Cleanup + +on: + pull_request: + types: [closed] + +jobs: + doc-preview-cleanup: + runs-on: ubuntu-latest + steps: + - name: Checkout gh-pages branch + uses: actions/checkout@v2 + with: + ref: gh-pages + - name: Delete preview and history + push changes + run: | + if [ -d "previews/PR$PRNUM" ]; then + git config user.name "Documenter.jl" + git config user.email "documenter@juliadocs.github.io" + git rm -rf "previews/PR$PRNUM" + 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: + PRNUM: ${{ github.event.number }} diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..382a0c2 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,23 @@ +name: Documentation + +on: + push: + branches: + - master + tags: '*' + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@latest + with: + version: '1.6' + - 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 + run: julia --color=yes --project=docs/ docs/make.jl diff --git a/docs/Project.toml b/docs/Project.toml new file mode 100644 index 0000000..1bc937b --- /dev/null +++ b/docs/Project.toml @@ -0,0 +1,5 @@ +[deps] +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" + +[compat] +Documenter = "0.26, 0.27" diff --git a/docs/make.jl b/docs/make.jl new file mode 100644 index 0000000..a7f814c --- /dev/null +++ b/docs/make.jl @@ -0,0 +1,16 @@ +using Documenter, RandomQuantum + +makedocs( + sitename = "RandomQuantum", + modules = [RandomQuantum], + format = Documenter.HTML(; prettyurls = get(ENV, "CI", nothing) == "true"), + pages = [ + "index.md" + ] +) + +deploydocs(; + repo = "github.com/BBN-Q/RandomQuantum.jl.git", + push_preview = true +) + diff --git a/docs/src/index.md b/docs/src/index.md new file mode 100644 index 0000000..575d5df --- /dev/null +++ b/docs/src/index.md @@ -0,0 +1,29 @@ +# RandomQuantum Documentation + +```@content +``` + +## Functions + +More info to come + +## Data Structs + +```@docs +GinibreEnsemble +FubiniStudyPureState +FubiniStudyMixedState +HilbertSchmidtMixedState +BuresMixedState +ClosedHaarEnsemble +OpenHaarEnsemble +GUE +RandomClosedEvolution +RandomOpenEvolution +``` + +## Index + +```@index +``` +