Skip to content

Commit

Permalink
Documenter (#85)
Browse files Browse the repository at this point in the history
* 0.7.5

* documenter

* Apply suggestions from code review

Co-authored-by: David Widmann <[email protected]>

* docs wip

* Apply suggestions from code review

Co-authored-by: David Widmann <[email protected]>

* DocCleapup

---------

Co-authored-by: David Widmann <[email protected]>
  • Loading branch information
JaimeRZP and devmotion authored Jul 17, 2023
1 parent 2ff8f13 commit 84d1bd7
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/DocCleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Doc Preview Cleanup

on:
pull_request:
types: [closed]

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v3
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 "[email protected]"
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 }}
30 changes: 30 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Documentation

on:
push:
branches:
- master
tags: '*'
pull_request:

jobs:
build:
permissions:
contents: write
statuses: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: 1
- 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 }}
run: julia --project=docs/ docs/make.jl

1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build/
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
13 changes: 13 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Pkg

using Documenter
using AdvancedMH

# cp(joinpath(@__DIR__, "../README.md"), joinpath(@__DIR__, "src/index.md"))

makedocs(sitename = "AdvancedMH", format = Documenter.HTML(), modules = [AdvancedMH])

deploydocs(
repo = "github.com/TuringLang/AdvancedMH.jl.git",
push_preview = true, # allow PR to deploy
)
15 changes: 15 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# AdvancedMH.jl

Documentation for AdvancedMH.jl


## Structs
```@docs
MetropolisHastings
```

## Functions
```@docs
StaticMH
RWMH
```
1 change: 1 addition & 0 deletions docs/src/index.md

0 comments on commit 84d1bd7

Please sign in to comment.