Skip to content

Commit b4d768c

Browse files
committed
Update documentation template
1 parent 8b55ca8 commit b4d768c

28 files changed

Lines changed: 2023 additions & 1859 deletions

.github/workflows/build-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
os: [ubuntu-latest]
1212
runs-on: ${{ matrix.os }}
1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-python@v4
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
1616
with:
1717
python-version: ${{ matrix.python-version }}
1818
- name: Run image

.github/workflows/docs.yml

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
name: Deploy MkDocs
1+
name: deploy-book
22

33
on:
44
push:
55
branches:
66
- main
7-
- dev
8-
paths:
9-
- 'docs/**'
10-
- 'mkdocs.yml'
117
workflow_dispatch:
128

139
permissions:
@@ -20,51 +16,37 @@ concurrency:
2016
cancel-in-progress: false
2117

2218
jobs:
23-
build:
19+
deploy-book:
2420
runs-on: ubuntu-latest
2521
steps:
26-
- name: Checkout
27-
uses: actions/checkout@v4
28-
with:
29-
fetch-depth: 0
22+
- uses: actions/checkout@v4
3023

3124
- name: Set up Python
3225
uses: actions/setup-python@v5
3326
with:
34-
python-version: '3.x'
35-
36-
- name: Install Poetry
37-
uses: snok/install-poetry@v1
38-
with:
39-
virtualenvs-create: true
40-
virtualenvs-in-project: true
41-
42-
- name: Load cached venv
43-
id: cached-poetry-dependencies
44-
uses: actions/cache@v4
45-
with:
46-
path: .venv
47-
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
27+
python-version: "3.12"
4828

4929
- name: Install dependencies
50-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
51-
run: poetry install --no-interaction --no-root
30+
run: |
31+
pip install jupyter-book
32+
pip install .
5233
53-
- name: Build MkDocs site
54-
run: poetry run mkdocs build
34+
- name: Build the book
35+
run: |
36+
jupyter-book build . --path-output out
5537
5638
- name: Upload artifact
5739
uses: actions/upload-pages-artifact@v3
5840
with:
59-
path: ./site
41+
path: ./out/_build/html
6042

6143
deploy:
6244
environment:
6345
name: github-pages
6446
url: ${{ steps.deployment.outputs.page_url }}
6547
runs-on: ubuntu-latest
66-
needs: build
48+
needs: deploy-book
6749
steps:
6850
- name: Deploy to GitHub Pages
6951
id: deployment
70-
uses: actions/deploy-pages@v4
52+
uses: actions/deploy-pages@v4

.github/workflows/pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1515
contents: read # Required for checkout
1616
steps:
17-
- uses: actions/checkout@v3
18-
- uses: actions/setup-python@v4
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-python@v5
1919
with:
2020
python-version: 3.9
2121
- name: Poetry image

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ venv.bak/
140140
# Rope project settings
141141
.ropeproject
142142

143-
# mkdocs documentation
143+
# Jupyter Book build output
144+
/out/
145+
146+
# mkdocs documentation (legacy)
144147
/site
145148

146149
# mypy

_config.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Book settings
2+
# Learn more at https://jupyterbook.org/customize/config.html
3+
4+
title: DAPI - DesignSafe API
5+
author: Krishna Kumar, Pedro Arduino, Scott Brandenberg
6+
logo: docs/nheri.png
7+
copyright: "2024"
8+
9+
# Force re-execution of notebooks on each build.
10+
# See https://jupyterbook.org/content/execute.html
11+
exclude_patterns:
12+
- _build
13+
- out
14+
- "**.ipynb_checkpoints"
15+
- examples
16+
- README.md
17+
- AUTHORS.md
18+
- LICENSE.md
19+
- mkdocs.yml
20+
21+
execute:
22+
execute_notebooks: "off"
23+
24+
launch_buttons:
25+
notebook_interface: "jupyterlab"
26+
colab_url: "https://colab.research.google.com"
27+
28+
# Information about where the book exists on the web
29+
repository:
30+
url: https://github.com/DesignSafe-CI/dapi
31+
branch: main
32+
33+
# Add GitHub buttons to your book
34+
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
35+
html:
36+
use_issues_button: true
37+
use_repository_button: true
38+
extra_navbar: ""
39+
40+
sphinx:
41+
extra_extensions:
42+
- sphinx.ext.autodoc
43+
- sphinx.ext.napoleon
44+
- sphinx.ext.viewcode
45+
config:
46+
napoleon_google_docstring: true
47+
napoleon_numpy_docstring: true
48+
autodoc_member_order: "bysource"

_toc.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Table of contents
2+
# Learn more at https://jupyterbook.org/customize/toc.html
3+
4+
format: jb-book
5+
root: docs/index
6+
parts:
7+
- caption: Getting Started
8+
chapters:
9+
- file: docs/installation
10+
- file: docs/authentication
11+
- file: docs/quickstart
12+
- caption: User Guide
13+
chapters:
14+
- file: docs/jobs
15+
- file: docs/database
16+
- caption: Examples
17+
chapters:
18+
- file: docs/examples
19+
- file: docs/examples/apps
20+
- file: docs/examples/mpm
21+
- file: docs/examples/opensees
22+
- file: docs/examples/openfoam
23+
- file: docs/examples/database
24+
- caption: API Reference
25+
chapters:
26+
- file: docs/api/index
27+
- file: docs/api/client
28+
- file: docs/api/jobs
29+
- file: docs/api/files
30+
- file: docs/api/apps
31+
- file: docs/api/systems
32+
- file: docs/api/database
33+
- file: docs/api/auth
34+
- file: docs/api/exceptions

docs/api/apps.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ Application discovery and management for DesignSafe computational applications.
44

55
## Application Discovery
66

7-
::: dapi.apps.find_apps
7+
```{eval-rst}
8+
.. autofunction:: dapi.apps.find_apps
9+
```
810

911
## Application Details
1012

11-
::: dapi.apps.get_app_details
13+
```{eval-rst}
14+
.. autofunction:: dapi.apps.get_app_details
15+
```

docs/api/auth.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ Authentication and credential management for DesignSafe access.
44

55
## Authentication
66

7-
::: dapi.auth.init
7+
```{eval-rst}
8+
.. autofunction:: dapi.auth.init
9+
```

docs/api/client.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
The main client interface for all DAPI functionality. DSClient provides organized access to DesignSafe resources through the Tapis V3 API.
44

5-
::: dapi.client.DSClient
5+
```{eval-rst}
6+
.. autoclass:: dapi.client.DSClient
7+
:members:
8+
:undoc-members:
9+
:show-inheritance:
10+
```
611

712
## Accessing the Raw Tapis Client
813

@@ -26,30 +31,47 @@ jobs = tapis_client.jobs.getJobList()
2631
### When to Use the Raw Tapis Client
2732

2833
- Access Tapis APIs not yet wrapped by dapi
29-
- Use advanced search parameters not exposed by dapi
34+
- Use advanced search parameters not exposed by dapi
3035
- Implement custom functionality
3136
- Debug or troubleshoot API calls
3237
- Access experimental or new Tapis features
3338

34-
!!! warning
35-
When using the raw Tapis client, you'll need to handle errors and data formatting yourself. The dapi wrapper provides error handling and user-friendly formatting.
39+
:::{warning}
40+
When using the raw Tapis client, you'll need to handle errors and data formatting yourself. The dapi wrapper provides error handling and user-friendly formatting.
41+
:::
3642

3743
## Service Interfaces
3844

3945
The DSClient provides access to different DesignSafe services through specialized interface classes:
4046

4147
### AppMethods
4248

43-
::: dapi.client.AppMethods
49+
```{eval-rst}
50+
.. autoclass:: dapi.client.AppMethods
51+
:members:
52+
:undoc-members:
53+
```
4454

4555
### FileMethods
4656

47-
::: dapi.client.FileMethods
57+
```{eval-rst}
58+
.. autoclass:: dapi.client.FileMethods
59+
:members:
60+
:undoc-members:
61+
```
4862

4963
### JobMethods
5064

51-
::: dapi.client.JobMethods
65+
```{eval-rst}
66+
.. autoclass:: dapi.client.JobMethods
67+
:members:
68+
:undoc-members:
69+
```
5270

5371
### SystemMethods
5472

55-
::: dapi.client.SystemMethods
73+
```{eval-rst}
74+
.. autoclass:: dapi.client.SystemMethods
75+
:members:
76+
:undoc-members:
77+
```

docs/api/database.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,24 @@ Database connections and query execution for DesignSafe research databases.
44

55
## Database Accessor
66

7-
::: dapi.db.accessor.DatabaseAccessor
7+
```{eval-rst}
8+
.. autoclass:: dapi.db.accessor.DatabaseAccessor
9+
:members:
10+
:undoc-members:
11+
:show-inheritance:
12+
```
813

914
## Database Engine
1015

11-
::: dapi.db.db.DSDatabase
16+
```{eval-rst}
17+
.. autoclass:: dapi.db.db.DSDatabase
18+
:members:
19+
:undoc-members:
20+
:show-inheritance:
21+
```
1222

1323
## Database Configuration
1424

15-
::: dapi.db.config.db_config
25+
```{eval-rst}
26+
.. autodata:: dapi.db.config.db_config
27+
```

0 commit comments

Comments
 (0)