From 69ec5744f3ddd2c9f01eaf76d7ef1ceb8f5a99a6 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 10 Jul 2026 19:39:39 -0300 Subject: [PATCH 1/4] add ioos header --- .github/workflows/deploy-docs.yml | 1 + .pre-commit-config.yaml | 4 ++-- jupyterbook/_config.yml | 5 +++-- jupyterbook/add_header.py | 24 ++++++++++++++++++++++++ 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 jupyterbook/add_header.py diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index dd95f62a..7ba0d71f 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -33,6 +33,7 @@ jobs: set -e && pip install "jupyter-book<2" && jupyter-book build jupyterbook + && python jupyterbook/add_header.py - name: GitHub Pages action if: success() && github.event_name == 'release' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 98e935ef..e6589fc2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: - id: add-trailing-comma - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.20 + rev: v0.15.22 hooks: - id: ruff @@ -55,7 +55,7 @@ repos: - id: nb-strip-paths - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.26.1 + rev: v1.28.0 hooks: - id: zizmor diff --git a/jupyterbook/_config.yml b/jupyterbook/_config.yml index 1ee27138..dd3de465 100644 --- a/jupyterbook/_config.yml +++ b/jupyterbook/_config.yml @@ -1,5 +1,5 @@ # Book settings -title: The U.S. Integrated Ocean Observing System (IOOS) # The title of the book. Will be placed in the left navbar. +title: The U.S. Integrated Ocean Observing System (IOOS) author: IOOS # The author of the book logo: images/IOOS_logo.png # A path to the book logo @@ -44,7 +44,8 @@ html: use_edit_page_button: false # Whether to add an "edit this page" button to pages. If `true`, repository information in repository: must be filled in use_repository_button: true # Whether to add a link to your repository button use_issues_button: true # Whether to add an "open an issue" button - extra_navbar: IOOS # Will be displayed underneath the left navbar. + # Hitting https://github.com/jupyter-book/jupyter-book/issues/1966 + extra_navbar: IOOS extra_footer: ioos.noaa.gov   Facebook   Twitter   diff --git a/jupyterbook/add_header.py b/jupyterbook/add_header.py new file mode 100644 index 00000000..27cbddb2 --- /dev/null +++ b/jupyterbook/add_header.py @@ -0,0 +1,24 @@ +from pathlib import Path + +path = Path(__file__).absolute().parent + + +def add_header(fname): + ioos_ui_components_min_js = """\n\n""" + ioos_header = """\n\n""" + + with open(fname) as f: + lines = f.readlines() + + with open(fname, "w") as out: + for line in lines: + if line.strip().startswith(" Date: Thu, 23 Jul 2026 15:39:52 -0300 Subject: [PATCH 2/4] use pixi to lock env page buid env --- .gitattributes | 2 ++ .github/workflows/deploy-docs.yml | 12 +++--------- .gitignore | 4 ++++ pixi.toml | 14 ++++++++++++++ 4 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 .gitattributes create mode 100644 pixi.toml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..997504b4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# SCM syntax highlighting & preventing 3-way merges +pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 7ba0d71f..f5085498 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -23,17 +23,11 @@ jobs: with: persist-credentials: false - - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 - with: - python-version: "3.x" + - name: Setup pixi + uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0 - name: Build documentation - run: > - set -e - && pip install "jupyter-book<2" - && jupyter-book build jupyterbook - && python jupyterbook/add_header.py + run: pixi run jb - name: GitHub Pages action if: success() && github.event_name == 'release' diff --git a/.gitignore b/.gitignore index dcc3b77b..f11ba3c4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,7 @@ *.swp .ipynb_checkpoints/ index.html +# pixi environments +.pixi/* +!.pixi/config.toml +pixi.lock diff --git a/pixi.toml b/pixi.toml new file mode 100644 index 00000000..ece6c9ba --- /dev/null +++ b/pixi.toml @@ -0,0 +1,14 @@ +[workspace] +authors = ["Filipe Fernandes "] +channels = ["conda-forge"] +name = "ioos_code_lab" +platforms = ["linux-64"] +version = "0.1.0" + +[tasks] +build_html = { cmd = ["jupyter-book", "build", "jupyterbook"] } +jb = { cmd = "python jupyterbook/add_header.py", depends-on=["build_html"] } + +[dependencies] +jupyter-book = ">=1.0.4,<2" +pydata-sphinx-theme = "==0.16.1" From 83b384ef86be3ca3eafdfd4fc6b386a43563cd6f Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Thu, 23 Jul 2026 15:51:07 -0300 Subject: [PATCH 3/4] add linkcheck step --- .github/workflows/docs-linkchecker.yml | 16 ++++++---------- pixi.toml | 1 + 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docs-linkchecker.yml b/.github/workflows/docs-linkchecker.yml index 8970d888..847b8595 100644 --- a/.github/workflows/docs-linkchecker.yml +++ b/.github/workflows/docs-linkchecker.yml @@ -11,20 +11,16 @@ on: jobs: build-docs: runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: - fetch-depth: 0 persist-credentials: false - - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 - with: - python-version: "3.x" + - name: Setup pixi + uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0 - - name: Linkcheck - run: > - set -e - && pip install "jupyter-book<2" - && jupyter-book build jupyterbook --builder linkcheck + - name: Build documentation + run: pixi run linkcheck diff --git a/pixi.toml b/pixi.toml index ece6c9ba..4734efc7 100644 --- a/pixi.toml +++ b/pixi.toml @@ -8,6 +8,7 @@ version = "0.1.0" [tasks] build_html = { cmd = ["jupyter-book", "build", "jupyterbook"] } jb = { cmd = "python jupyterbook/add_header.py", depends-on=["build_html"] } +linkcheck = { cmd = "jupyter-book build jupyterbook --builder linkcheck" } [dependencies] jupyter-book = ">=1.0.4,<2" From 521bdd7adef582645dc7bbcf612c104cc8998fe6 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Thu, 23 Jul 2026 16:02:08 -0300 Subject: [PATCH 4/4] update link --- .../2017-05-14-running_compliance_checker.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jupyterbook/content/code_gallery/data_management_notebooks/2017-05-14-running_compliance_checker.ipynb b/jupyterbook/content/code_gallery/data_management_notebooks/2017-05-14-running_compliance_checker.ipynb index 234000b4..96fb4424 100644 --- a/jupyterbook/content/code_gallery/data_management_notebooks/2017-05-14-running_compliance_checker.ipynb +++ b/jupyterbook/content/code_gallery/data_management_notebooks/2017-05-14-running_compliance_checker.ipynb @@ -48,7 +48,7 @@ "\n", "Created: 2017-05-14\n", "\n", - "The IOOS Compliance Checker is a Python-based tool that helps users check the meta data compliance of a netCDF file. This software can be run in a web interface here: [https://ioos.github.io/compliance-checker-wasm-web/ioos_cc_browser.html](https://ioos.github.io/compliance-checker-wasm-web/ioos_cc_browser.html) The checker can also be run as a Python tool either on the command line or in a Python script. This notebook demonstrates the python usage of the Compliance Checker.\n", + "The IOOS Compliance Checker is a Python-based tool that helps users check the meta data compliance of a netCDF file. This software can be run in a web interface here: [https://compliance.ioos.us/](https://compliance.ioos.us/) The checker can also be run as a Python tool either on the command line or in a Python script. This notebook demonstrates the python usage of the Compliance Checker.\n", "\n", "## Purpose:\n", "\n", @@ -249,7 +249,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.14.4" + "version": "3.14.5" } }, "nbformat": 4,