Skip to content

Commit

Permalink
Add JupyterBook docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rafmudaf committed Mar 5, 2024
1 parent 0f0d06e commit 391bd14
Show file tree
Hide file tree
Showing 6 changed files with 453 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/deploy-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: deploy-pages

on:
push:
# branches:
# - develop
paths:
- docs/**

# This job installs dependencies, builds the book, and pushes it to `gh-pages`
jobs:
deploy-book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Install dependencies
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: |
pip install -e ".[docs]"
# Build the book
- name: Build the book
working-directory: ${{runner.workspace}}/wcomp/docs/
run: |
jupyter-book build .
# Push the book's HTML to github-pages
- name: GitHub Pages action
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
67 changes: 67 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Book settings
# Learn more at https://jupyterbook.org/customize/config.html

title: wcomp
author: Rafael Mudafort
# logo: logo.png

execute:
execute_notebooks: force

# Define the name of the latex output file for PDF builds
# latex:
# latex_documents:
# targetname: book.tex

bibtex_bibfiles:
- references.bib

repository:
url: https://github.com/rafmudaf/wcomp
path_to_book: docs
branch: main

html:
use_issues_button: true
use_repository_button: true

sphinx:
mermaid_version: 10.7.0
extra_extensions:
- 'sphinx.ext.autodoc'
- 'sphinx.ext.autosummary'
- 'sphinx.ext.viewcode'
# - 'sphinx_autodoc_typehints'
# - 'sphinxcontrib.autoyaml'
- 'sphinx.ext.napoleon' # Formats google and numpy docstring styles
- 'sphinxcontrib.mermaid'

config:
# html_theme: sphinx_book_theme
# templates_path:
# - '_templates'
language: 'python'
nb_execution_show_tb: true # Shows the stack trace in stdout; its suppressed otherwise.
nb_execution_raise_on_error: true # Stops the Sphinx build if there is an error in a notebook. See https://github.com/executablebooks/jupyter-book/issues/2011
# suppress_warnings:
# - etoc.toctree # autodoc output contains toctrees, so suppress this warning. See https://github.com/executablebooks/sphinx-external-toc/issues/36
# autoyaml_level: 3
autosummary_generate: true

# Autodoc config reference
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#configuration
autodoc_default_options:
members: true
member-order: bysource
undoc-members: true
private-members: false
# special-members: true
# inherited-members
# show-inheritance
# ignore-module-all
# imported-members: true
# exclude-members
# class-doc-from
# no-value
autodoc_typehints: both
mermaid_version: "10.8"
7 changes: 7 additions & 0 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Table of contents
# Learn more at https://jupyterbook.org/customize/toc.html

format: jb-book
root: index
chapters:
- file: api_docs
14 changes: 14 additions & 0 deletions docs/api_docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# API Documentation

```{eval-rst}
.. autosummary::
:toctree: _autosummary
:recursive:
wcomp.base_interface
wcomp.floris_interface
wcomp.foxes_interface
wcomp.pywake_interface
wcomp.output_struct
wcomp.plotting
```
Loading

0 comments on commit 391bd14

Please sign in to comment.