Skip to content

Commit bde3be1

Browse files
authored
Merge pull request #7 from bsipocz/ENH_switch_to_JB2
ENH: switching to JB2 with the docs
2 parents a6b567c + d2fb5e1 commit bde3be1

File tree

8 files changed

+126
-88
lines changed

8 files changed

+126
-88
lines changed

.circleci/config.yml

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,66 @@
11
version: 2.1
22

3-
jobs:
43

4+
jobs:
55
build-docs:
66
docker:
7-
- image: cimg/python:3.11
8-
7+
- image: cimg/python:3.13
98
steps:
109
- checkout
1110

11+
- restore_cache:
12+
keys:
13+
- node-cache-v1
14+
15+
- restore_cache:
16+
keys:
17+
- pip-cache-{{ checksum "site_requirements.txt" }}
18+
19+
- run:
20+
name: Install Node.js
21+
command: |
22+
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
23+
sudo apt-get install -y nodejs
24+
1225
- run:
13-
name: Install CI dependencies
14-
command: python -m pip install --upgrade tox
26+
name: Install mystmd
27+
command: |
28+
npm install mystmd
29+
30+
- run:
31+
name: Install Python dependencies
32+
command: |
33+
python -m pip install --upgrade pip
34+
if [ -f site_requirements.txt ]; then pip install -r site_requirements.txt; fi
35+
36+
- save_cache:
37+
key: node-cache-v1
38+
paths:
39+
- node_modules
40+
41+
- save_cache:
42+
key: pip-cache-{{ checksum "site_requirements.txt" }}
43+
paths:
44+
- ~/.cache/pip
1545

1646
- run:
17-
name: Build HTML rendering of notebooks
18-
no_output_timeout: 30m
47+
name: Build documentation
48+
environment:
49+
# Ensure this is same as store_artifacts path below
50+
DOCS_PATH: _build/html
1951
command: |
20-
python -m tox -e buildhtml
52+
export BASE_URL="/output/job/$CIRCLE_WORKFLOW_JOB_ID/artifacts/0/$DOCS_PATH"
53+
54+
(npx myst build --html)
55+
56+
## Temporary hack to remove unused thebe JS
57+
rm _build/html/*thebe*.js
2158
2259
- store_artifacts:
2360
path: _build/html
2461

2562
workflows:
2663
version: 2
27-
default:
64+
build-and-docs:
2865
jobs:
2966
- build-docs

.github/workflows/ci_publish.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/deploy_pages.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy docs on GitHub Pages
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
env:
9+
# `BASE_URL` determines, relative to the root of the domain, the URL that your site is served from.
10+
# E.g., if your site lives at `https://mydomain.org/myproject`, set `BASE_URL=/myproject`.
11+
# If, instead, your site lives at the root of the domain, at `https://mydomain.org`, set `BASE_URL=''`.
12+
BASE_URL: /${{ github.event.repository.name }}
13+
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
concurrency:
20+
group: 'pages'
21+
cancel-in-progress: false
22+
23+
jobs:
24+
deploy_docs:
25+
environment:
26+
name: github-pages
27+
url: ${{ steps.deployment.outputs.page_url }}
28+
29+
runs-on: ubuntu-latest
30+
steps:
31+
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Setup Pages
36+
uses: actions/configure-pages@v3
37+
38+
- uses: actions/setup-node@v4
39+
with:
40+
node-version: 18.x
41+
42+
- name: Install Jupyter Book (via myst)
43+
run: npm install -g jupyter-book
44+
45+
- name: Build HTML Assets
46+
run: jupyter-book build --html
47+
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v3
50+
with:
51+
path: './_build/html'
52+
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# MyST build outputs
2+
_build

documentation/index.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,6 @@ The community will also mine SPHEREx data and combine it with synergistic data s
1919
More information is available in the "Mission Overview" section of the SPHEREx Explanatory Supplement.
2020

2121

22-
## SPHEREx Data at IRSA
23-
24-
```{toctree}
25-
---
26-
maxdepth: 1
27-
---
28-
29-
spherex_data_products
30-
spherex_data_access
31-
```
32-
33-
3422
## Additional Resources
3523

3624
[SPHEREx archive at IRSA](https://irsa.ipac.caltech.edu/Missions/spherex.html)

myst.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See docs at: https://mystmd.org/guide/frontmatter
2+
version: 1
3+
project:
4+
id: 236e8a7d-de48-4c6b-a0c5-c4bfe3012ea0
5+
# title:
6+
# description:
7+
# keywords: []
8+
# authors: []
9+
# github:
10+
toc:
11+
# Auto-generated by `myst init --write-toc`
12+
- file: documentation/index.md
13+
- title: SPHEREx Data Access
14+
15+
file: documentation/spherex_data_access.md
16+
- title: SPHEREx Data Products at IRSA
17+
file: documentation/spherex_data_products.md
18+
19+
site:
20+
template: book-theme
21+
options:
22+
favicon: _static/irsa-favicon.ico
23+
logo: _static/irsa_logo.png

site_requirements.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
sphinx
2-
myst-nb
3-
sphinx-book-theme
4-
sphinx-copybutton

tox.ini

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)