Skip to content

Commit 9d2f6ab

Browse files
Merge pull request #35 from SciNim/addDocs
build docs in CI when pushing to master
2 parents 5c88d16 + 4edf1f5 commit 9d2f6ab

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

.github/workflows/docs.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Generate numericalnim docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
gen:
10+
name: Generate and deploy docs
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: iffy/install-nim@v4
16+
- name: Generate
17+
run: |
18+
nimble install -y
19+
nimble docs
20+
- name: Deploy
21+
uses: peaceiris/actions-gh-pages@v3
22+
with:
23+
github_token: ${{ secrets.GITHUB_TOKEN }}
24+
publish_dir: ./docs

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ bin/
44
.vscode/
55
*.code-workspace
66
*.html
7+
docs/

numericalnim.nimble

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@ task test, "Run all tests":
3030
exec "nim c -r tests/test_optimize.nim"
3131
exec "nim c -r tests/test_utils.nim"
3232
exec "nim c -r tests/test_vector.nim"
33+
34+
task docs, "Generate documentation":
35+
# Based on Nico's script
36+
exec "nim doc --project --index:on --git.url:https://github.com/SciNim/numericalnim --git.commit:master --outdir:docs src/numericalnim.nim"
37+
exec "echo \"<meta http-equiv=\\\"Refresh\\\" content=\\\"0; url='theindex.html'\\\" />\" >> docs/index.html"

0 commit comments

Comments
 (0)