Skip to content

Commit

Permalink
docs: create hybrid navigation (#106)
Browse files Browse the repository at this point in the history
Meaning a top navbar for the major chapters, and a sidebar for the
sections. Right now only the Python package docs have multiple pages. We
still need to re-arrange to have chapters for the core and the QGIS
plugin as well.

There seems to be a quarto bug that if I don't add a second sidebar
entry, it shows the contents for all chapters, hence I added "To be
continued".

Based on:
-
https://quarto.org/docs/websites/website-navigation.html#hybrid-navigation
- https://deltares.github.io/iMOD-Documentation/
  • Loading branch information
visr authored Mar 14, 2023
1 parent bf6c7e3 commit 0d7df01
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 13 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ jobs:

- name: Generate API pages
working-directory: docs
run: python -m quartodoc build
# objects.json: https://github.com/machow/quartodoc/issues/63
run: |
python -m quartodoc build
rm objects.json
- name: Render Quarto Project
run: "quarto render docs --to html --execute"
Expand Down
1 change: 0 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
/_site/
/docs/python/reference/
*.html
/objects.json
34 changes: 26 additions & 8 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,40 @@
project:
type: website
resources:
- objects.json

website:
title: "Ribasim"
page-navigation: true
navbar:
logo: https://user-images.githubusercontent.com/4471859/224825908-bee7e044-bc6b-4561-8b08-5d330cce3ed5.png
left:
- equations.qmd
- modflow.qmd
- coupling-demo.qmd
- developer.qmd
- python/index.qmd
- text: "Equations"
file: equations.qmd
- text: "Modflow"
file: modflow.qmd
- text: "Coupling"
file: coupling-demo.qmd
- text: "Developer"
file: developer.qmd
- text: "Python"
file: python/index.qmd
right:
- icon: github
href: https://github.com/Deltares/Ribasim
aria-label: GitHub

sidebar:
- title: "Python"
contents:
- python/index.qmd
- python/examples.ipynb
- python/reference/index.qmd
- title: "To be continued"
contents: []

format:
html:
theme: cosmo
css: styles.css
css: assets/styles.css
toc: true

bibliography: references.bib
Expand Down
File renamed without changes.
3 changes: 0 additions & 3 deletions docs/python/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ Python instead.
One can also use Ribasim Python to build entire models from base data, such that your model
setup is fully reproducible.

- [Examples](examples.ipynb)
- [API reference](reference/)

The package is [registered in PyPI](https://pypi.org/project/ribasim/) and can therefore
be installed with `pip install ribasim`.

0 comments on commit 0d7df01

Please sign in to comment.