Skip to content

Commit

Permalink
Merge pull request #54 from justinlaughlin/finsberg/jupyter-book
Browse files Browse the repository at this point in the history
Use jupyterbook and github pages instead of pure sphinx and readthedocs
  • Loading branch information
justinlaughlin authored Feb 6, 2023
2 parents 4eee0b8 + 7bae5b5 commit a8b3700
Show file tree
Hide file tree
Showing 35 changed files with 984 additions and 656 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches:
- "**"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:

build:
runs-on: ubuntu-22.04
container: ghcr.io/scientificcomputing/fenics:2023-01-16
env:
DEB_PYTHON_INSTALL_LAYOUT: deb_system
PUBLISH_DIR: ./_build/html

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies
run: python3 -m pip install --no-binary=h5py ".[docs,dev]"

- name: Build docs
run: jupyter book build .

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ${{ env.PUBLISH_DIR }}

# Single deploy job since we're just deploying
deploy:
if: github.ref == 'refs/heads/development'
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Pages
uses: actions/configure-pages@v2


- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
5 changes: 3 additions & 2 deletions .github/workflows/test_fenics_stubs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ jobs:
- uses: actions/checkout@v3

- name: "Install code"
run: python3 -m pip install --no-binary=h5py .[dev]
run: python3 -m pip install --no-binary=h5py .[dev] jupytext

- name: Run example 1
run: |
cd examples/example1/
python3 example1_driver.py
jupytext example1.ipynb --to py
python3 example1.py
# - name: Run tests
# run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
_build
examples/example1/mesh/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
25 changes: 0 additions & 25 deletions .readthedocs.yml

This file was deleted.

38 changes: 38 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Book settings
# Learn more at https://jupyterbook.org/customize/config.html

title: fenics-subs
author: Justin Laughlin
copyright: "2022"
only_build_toc_files: true

# Force re-execution of notebooks on each build.
# See https://jupyterbook.org/content/execute.html
execute:
execute_notebooks: cache
timeout: 3000

# Information about where the book exists on the web
repository:
url: https://github.com/justinlaughlin/stubs # Online location of your book
branch: development


html:
use_issues_button: true
use_repository_button: true

parse:
myst_enable_extensions:
- amsmath
- dollarmath
- linkify

sphinx:

extra_extensions:
- 'sphinx.ext.autodoc'
- 'sphinx.ext.napoleon'
- 'sphinx.ext.viewcode'
- 'sphinx.ext.autosummary'

15 changes: 15 additions & 0 deletions _toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
format: jb-book
root: docs/index

parts:
- caption: Getting started
chapters:
- file: docs/install
- file: docs/math
- file: docs/faq
- caption: Demo
chapters:
- file: examples/example1/example1
- caption: API documentation
chapters:
- file: "docs/pystubs_verbose.rst"
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

65 changes: 65 additions & 0 deletions docs/_pythonapi/stubs.common.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
stubs.common
============

.. automodule:: stubs.common







.. rubric:: Functions

.. autosummary::

DemoCuboidsMesh
append_meshfunction_to_meshdomains
bmesh_to_parent
convert_xml_to_hdf5
cube_condition
data_path
empty_sbmodel
face_topology
find_steady_state
insert_dataframe_col
interp_limit_dy
json_to_ObjectContainer
mesh_vertex_to_dof
nan_to_none
np_smart_hstack
pint_quantity_to_unit
pint_unit_to_quantity
read_hdf5
read_sbmodel
round_to_n
sbmodel_from_locals
stubs_expressions
sub
submesh_dof_to_mesh_dof
submesh_dof_to_vertex
submesh_to_bmesh
sum_discrete_signals
write_mesh
write_sbmodel
zplane_condition





.. rubric:: Classes

.. autosummary::

Stopwatch
ref









29 changes: 29 additions & 0 deletions docs/_pythonapi/stubs.config.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
stubs.config
============

.. automodule:: stubs.config











.. rubric:: Classes

.. autosummary::

Config









31 changes: 31 additions & 0 deletions docs/_pythonapi/stubs.data_manipulation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
stubs.data\_manipulation
========================

.. automodule:: stubs.data_manipulation











.. rubric:: Classes

.. autosummary::

Data
PostProcessor
Probe









30 changes: 30 additions & 0 deletions docs/_pythonapi/stubs.mesh.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
stubs.mesh
==========

.. automodule:: stubs.mesh











.. rubric:: Classes

.. autosummary::

ChildMesh
ParentMesh









29 changes: 29 additions & 0 deletions docs/_pythonapi/stubs.model.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
stubs.model
===========

.. automodule:: stubs.model











.. rubric:: Classes

.. autosummary::

Model









Loading

0 comments on commit a8b3700

Please sign in to comment.