Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Jupyter Book #2875

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/jupyterbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build Jupyter Book

on:
workflow_dispatch:
push:
branches:
- '*'
pull_request:
branches:
- master

defaults:
run:
shell: bash -l {0}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true


jobs:
build:
runs-on: ubuntu-latest
environment:
name: github-pages
permissions:
pages: write
id-token: write
steps:
- uses: actions/checkout@v4

- uses: actions/checkout@v4
with:
repository: tardis-sn/tardis-regression-data
path: tardis-regression-data
lfs: true
sparse-checkout: |
atom_data/kurucz_cd23_chianti_H_He.h5

- name: Setup environment
uses: ./.github/actions/setup_env
with:
os-label: linux-64

- run: |
micromamba install jupyter-book sphinx-autoapi
pip install -e . --user

- name: Copy atom_data
run: |
mkdir -p ~/Downloads/tardis-data && cp -a ./tardis-regression-data/atom_data/. ~/Downloads/tardis-data

- name: Build the book
run: |
jupyter-book build --all docs

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: "docs_new/_build/html"

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3
47 changes: 47 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Book settings
# Learn more at https://jupyterbook.org/customize/config.html

title: TARDIS Documentation
author: TARDIS RT Collaboration
logo: graphics/tardis_banner.svg

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

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

# Add a bibtex file so that we can create citations
bibtex_bibfiles:
- references.bib

# Information about where the book exists on the web
repository:
url: https://github.com/executablebooks/jupyter-book # Online location of your book
path_to_book: docs # Optional path to your book, relative to the repository root
branch: master # Which branch of the repository should be used when creating links (optional)

# Add GitHub buttons to your book
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
html:
use_issues_button: true
use_repository_button: true


sphinx:
extra_extensions:
- 'sphinx.ext.autodoc'
- 'sphinx.ext.autosummary'
- 'sphinx.ext.viewcode'
- 'autoapi.extension'
config:
html_extra_path: ['screenshots']
autodoc_member_order: 'bysource'
autosummary_generate: True
autoapi_dirs: ['../tardis']
autoapi_options: [ 'members', 'undoc-members', 'private-members', 'show-inheritance', 'show-module-summary', 'special-members', ]
38 changes: 38 additions & 0 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
format: jb-book
root: index
parts:
- caption: Getting Started
chapters:
- file: installation
- file: quickstart
- file: tutorials
- caption: Input/Output
chapters:
- file: io/hdf/index
- file: io/configuration/index
- file: io/model/index
- file: io/optional/index
- file: io/visualization/index
- file: io/output/index
- file: io/grid/TardisGridTutorial
- caption: Physics Walkthrough
chapters:
- file: physics/intro/index
- file: physics/setup/index
- file: physics/montecarlo/index
- file: physics/update_and_conv/update_and_conv
- file: physics/spectrum/index
- file: physics/tardisgamma/index
- caption: Contributing to TARDIS
chapters:
- file: contributing/CONTRIBUTING
- file: contributing/development/index
- file: contributing/tools/index
- file: contributing/CHANGELOG
- file: contributing/in_progress/index
- caption: Other Resources
chapters:
- file: resources/credits
- file: resources/research_done_using_TARDIS/research_papers
- file: resources/code_comparison/index
- file: resources/zreferences
8 changes: 8 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
API documentation
=================

.. autosummary::
:toctree: _autosummary
:recursive:

tardis
Loading