Skip to content

Commit

Permalink
Merge pull request #254 from JMGilbert/main
Browse files Browse the repository at this point in the history
Add DSCIM mkdocs documentation page
  • Loading branch information
kemccusker authored May 30, 2024
2 parents 5a72e74 + 416aa5b commit 8c3e7c5
Show file tree
Hide file tree
Showing 20 changed files with 129 additions and 3 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: website
on:
push:
branches:
- master
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material mkdocstrings[python]
- run: mkdocs gh-deploy --force
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ serve as the main classes to call different menu options.

```mermaid
graph TD
SubGraph1Flow(Storage and I/O)
subgraph "Storage utilities"
SubGraph1Flow --> A[Stacked_damages]
Expand All @@ -67,7 +66,7 @@ SubGraph1Flow(Storage and I/O)
B[MainMenu] --> C[AddingUpRecipe];
B[MainMenu] --> D[RiskAversionRecipe];
B[MainMenu] --> E[EquityRecipe]
end
end
```

`StackedDamages` takes care of parsing all monetized damage data from several
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--8<-- "CHANGELOG.md"
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--8<-- "README.md"
1 change: 1 addition & 0 deletions docs/menu/baseline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: dscim.menu.baseline
1 change: 1 addition & 0 deletions docs/menu/decorators.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: dscim.menu.decorators
1 change: 1 addition & 0 deletions docs/menu/equity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: dscim.menu.equity
1 change: 1 addition & 0 deletions docs/menu/main_recipe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: dscim.menu.main_recipe
1 change: 1 addition & 0 deletions docs/menu/risk_aversion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: dscim.menu.risk_aversion
1 change: 1 addition & 0 deletions docs/menu/simple_storage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: dscim.menu.simple_storage
1 change: 1 addition & 0 deletions docs/preprocessing/input_damages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: dscim.preprocessing.input_damages
1 change: 1 addition & 0 deletions docs/preprocessing/midprocessing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: dscim.preprocessing.midprocessing
1 change: 1 addition & 0 deletions docs/preprocessing/preprocessing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: dscim.preprocessing.preprocessing
11 changes: 11 additions & 0 deletions docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[data-md-color-scheme="CILlight"] {
--md-primary-fg-color: #4DC8D6;
--md-primary-fg-color--light: #BAE8E2;
--md-primary-fg-color--dark: #3393B0;
}

[data-md-color-scheme="slate"] {
--md-primary-fg-color: #3393B0;
--md-primary-fg-color--light: #BAE8E2;
--md-primary-fg-color--dark: #3393B0;
}
1 change: 1 addition & 0 deletions docs/utils/functions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: dscim.utils.functions
1 change: 1 addition & 0 deletions docs/utils/menu_runs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: dscim.utils.menu_runs
1 change: 1 addition & 0 deletions docs/utils/rff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: dscim.utils.rff
1 change: 1 addition & 0 deletions docs/utils/utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: dscim.utils.utils
68 changes: 68 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json

site_name: dscim Documentation
repo_url: "https://github.com/climateimpactlab/dscim"

theme:
name: "material"

palette:

# Palette toggle for light mode
- scheme: CILlight
toggle:
icon: material/brightness-7
name: Switch to dark mode

# Palette toggle for dark mode
- scheme: slate
toggle:
icon: material/brightness-4
name: Switch to light mode

extra_css:
- stylesheets/extra.css

plugins:
- mkdocstrings:
default_handler: python
handlers:
python:
paths: [src]
options:
docstring_style: "numpy"
summary: true
separate_signature: true
show_object_full_path: true
show_root_toc_entry: false
- search

markdown_extensions:
- "pymdownx.snippets"
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format

nav:
- Home: index.md
- API Reference:
- dscim.menu:
- baseline: menu/baseline.md
- main_recipe: menu/main_recipe.md
- risk_aversion: menu/risk_aversion.md
- equity: menu/equity.md
- simple_storage: menu/simple_storage.md
- decorators: menu/decorators.md
- dscim.preprocessing:
- input_damages: preprocessing/input_damages.md
- midprocessing: preprocessing/midprocessing.md
- preprocessing: preprocessing/preprocessing.md
- dscim.utils:
- functions: utils/functions.md
- menu_runs: utils/menu_runs.md
- rff: utils/rff.md
- utils: utils/utils.md
- Changelog: changelog.md

10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,17 @@ dependencies = [
"zarr",
]

[project.optional-dependencies]
docs = [
"mkdocs",
"mkdocstrings[python]",
"mkdocs-material",
]


[project.urls]
Homepage = "https://github.com/ClimateImpactLab/dscim"
Documentation = "https://github.com/ClimateImpactLab/dscim"
Documentation = "https://ClimateImpactLab.github.io/dscim"
Source = "https://github.com/ClimateImpactLab/dscim"
"Bug Tracker" = "https://github.com/ClimateImpactLab/dscim/issues"

Expand Down

0 comments on commit 8c3e7c5

Please sign in to comment.