Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff
11 changes: 3 additions & 8 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +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
run: pixi run jb

- name: GitHub Pages action
if: success() && github.event_name == 'release'
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/docs-linkchecker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
*.swp
.ipynb_checkpoints/
index.html
# pixi environments
.pixi/*
!.pixi/config.toml
pixi.lock
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
5 changes: 3 additions & 2 deletions jupyterbook/_config.yml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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: <a href="https://ioos.us">IOOS</a> # Will be displayed underneath the left navbar.
# Hitting https://github.com/jupyter-book/jupyter-book/issues/1966
extra_navbar: <a href="https://ioos.us">IOOS</a>
extra_footer: <a href=https://ioos.noaa.gov> ioos.noaa.gov </a> &nbsp
<a href=https://www.facebook.com/usioosgov> Facebook </a> &nbsp
<a href=https://www.twitter.com/usioosgov> Twitter </a> &nbsp
Expand Down
24 changes: 24 additions & 0 deletions jupyterbook/add_header.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from pathlib import Path

path = Path(__file__).absolute().parent


def add_header(fname):
ioos_ui_components_min_js = """\n<script src="https://dgd6r9iiqa8y9.cloudfront.net/ioos-ui-components.min.js"></script>\n"""
ioos_header = """\n<ioos-header variant="compact" theme="auto"></ioos-header>\n"""

with open(fname) as f:
lines = f.readlines()

with open(fname, "w") as out:
for line in lines:
if line.strip().startswith("<title"):
line = line + f"\n{ioos_ui_components_min_js}"
if line.strip().startswith("<body"):
line = line + f"\n{ioos_header}"
out.write(line)


if "__main__" == __name__:
for fname in path.glob("_build/html/**/*.html"):
add_header(fname)
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -249,7 +249,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.4"
"version": "3.14.5"
}
},
"nbformat": 4,
Expand Down
15 changes: 15 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[workspace]
authors = ["Filipe Fernandes <ocefpaf@gmail.com>"]
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"] }
linkcheck = { cmd = "jupyter-book build jupyterbook --builder linkcheck" }

[dependencies]
jupyter-book = ">=1.0.4,<2"
pydata-sphinx-theme = "==0.16.1"
Loading