Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
055005b
feat: save WIP on tutorials
CodyCBakerPhD Nov 3, 2025
b7ba452
Merge branch 'main' into add_tutorial
CodyCBakerPhD Nov 3, 2025
ad4ec13
feat: saving state
CodyCBakerPhD Nov 4, 2025
5cff09e
Merge branch 'add_tutorial' of https://github.com/con/nwb2bids into a…
CodyCBakerPhD Nov 4, 2025
7c9c3d5
fix: add extra dep to docs
CodyCBakerPhD Nov 4, 2025
355c471
fix: add link
CodyCBakerPhD Nov 4, 2025
40c12d6
Merge branch 'fix_label_notification' into add_tutorial
CodyCBakerPhD Nov 4, 2025
14c838c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 4, 2025
0061fb6
feat: saving state
CodyCBakerPhD Nov 4, 2025
b02a0ca
Merge branch 'add_tutorial' of https://github.com/con/nwb2bids into a…
CodyCBakerPhD Nov 4, 2025
453921b
fix unix blocks, add advanced library usage
Nov 5, 2025
d983dad
Merge branch 'fix_label_notification' into add_tutorial
CodyCBakerPhD Nov 7, 2025
a0139c1
Apply suggestions from code review
CodyCBakerPhD Nov 7, 2025
cabda10
chore: pr suggestions
CodyCBakerPhD Nov 7, 2025
49dc2de
fix: tests
CodyCBakerPhD Nov 7, 2025
a68205a
feat: setup doctest and add some doctests
CodyCBakerPhD Nov 7, 2025
7f334f9
feat: finish remaining doctests
CodyCBakerPhD Nov 7, 2025
f1d5603
fix: fix on clean system
CodyCBakerPhD Nov 7, 2025
b06466a
fix: continue fixing on ci
CodyCBakerPhD Nov 7, 2025
2a4f7cb
Merge branch 'fix_label_notification' into add_tutorial
CodyCBakerPhD Nov 7, 2025
82282d9
Merge branch 'fix_label_notification' into add_tutorial
CodyCBakerPhD Nov 8, 2025
084ccd9
Merge branch 'fix_label_notification' into add_tutorial
CodyCBakerPhD Nov 12, 2025
d4cd788
Update tutorials for RunConfig signature changes
asmacdo Nov 12, 2025
6d008e2
Merge branch 'fix_label_notification' into add_tutorial
CodyCBakerPhD Nov 17, 2025
57aba89
Apply suggestions from code review
CodyCBakerPhD Nov 18, 2025
46627d7
Merge branch 'fix_label_notification' into add_tutorial
CodyCBakerPhD Nov 18, 2025
25cd350
Update OS list for remote tests in workflow
CodyCBakerPhD Nov 18, 2025
15e79f9
Merge branch 'fix_label_notification' into add_tutorial
CodyCBakerPhD Nov 18, 2025
314fb15
re-include Makefile; remove unpresent additional metadata description…
CodyCBakerPhD Nov 19, 2025
6f13e5f
better names all around
CodyCBakerPhD Nov 19, 2025
4748805
simplify CLI calls
CodyCBakerPhD Nov 19, 2025
703d6ed
fix doctest
CodyCBakerPhD Nov 19, 2025
7610aef
Merge branch 'main' into add_tutorial
CodyCBakerPhD Nov 19, 2025
a46a81b
Merge branch 'main' into add_tutorial
CodyCBakerPhD Nov 19, 2025
3abc8f5
Merge branch 'main' into add_tutorial
CodyCBakerPhD Nov 20, 2025
46a44f7
Merge branch 'main' into add_tutorial
CodyCBakerPhD Nov 26, 2025
cba3372
Merge branch 'main' into add_tutorial
CodyCBakerPhD Dec 1, 2025
d0f92a7
Merge branch 'main' into add_tutorial
CodyCBakerPhD Dec 1, 2025
4aa1818
Merge branch 'main' into add_tutorial
CodyCBakerPhD Dec 3, 2025
da9d9f4
Merge branch 'main' into add_tutorial
CodyCBakerPhD Dec 3, 2025
dfbac7b
PR suggestions
CodyCBakerPhD Dec 3, 2025
3df6f22
PR suggestions
CodyCBakerPhD Dec 3, 2025
e3b30ce
Apply suggestions from code review
CodyCBakerPhD Dec 3, 2025
02ab5fb
PR suggestions
CodyCBakerPhD Dec 3, 2025
22e6474
Merge branch 'add_tutorial' of https://github.com/con/nwb2bids into a…
CodyCBakerPhD Dec 3, 2025
9e73afe
Merge branch 'main' into add_tutorial
CodyCBakerPhD Dec 3, 2025
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
26 changes: 26 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Minimal makefile for Sphinx documentation

# You can set these variables from the command line.
SPHINXOPTS ?= -b html -W --keep-going
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = ./_build/

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Clean build directory
clean:
rm -rf $(BUILDDIR)

# Build HTML with automatic clean
html: clean
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21 changes: 13 additions & 8 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
# Documentation

To build the documentation locally:
To build the documentation, ensure you have all the necessary plugins installed:

```bash
# Install documentation dependencies
pip install -e . --group docs
```

then run locally using `Make` (with working directory being the `docs/` directory):

# Clean any previous local runs first
rm -r ./docs/_build
```bash
make html
```

# Build
sphinx-build -b html -W --keep-going docs ./docs/_build
or without `Make`:

# View the built documentation
# Open ./docs/_build/html/index.html in your favorite web browser
```bash
rm -rf _build
sphinx-build -b html -W --keep-going . _build
```

Then view the built documentation by opening `docs/_build/html/index.html` in your favorite web browser.
9 changes: 9 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* The primary sphinx copybutton for code blocks. */
button.copybtn {
opacity: 1;
}

/* Confusingly, this is the identifier for the toggleprompt button. */
span.copybutton {
opacity: 0;
}
37 changes: 35 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Configuration file for the Sphinx documentation builder."""

import pathlib
import sys
from pathlib import Path

# Add source directory to path for autodoc
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "src"))
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[2] / "src"))

# Project details
project = "nwb2bids"
Expand All @@ -18,6 +18,9 @@
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_tabs.tabs",
"sphinx_copybutton",
"sphinx_toggleprompt", # Used to control >>> behavior in the doctests
"myst_parser", # For including Markdown files to be rendered as RST
]

# HTML configuration
Expand All @@ -41,6 +44,9 @@
"doc_path": "docs",
}

html_static_path = ["_static"]
html_css_files = ["custom.css"]

# Format signatures for better readability
autodoc_typehints = "signature"
autodoc_typehints_format = "short"
Expand All @@ -53,9 +59,36 @@
# Disable sidebars for specific sections
html_sidebars = {
'user_guide': [],
'tutorials': [],
"developer_guide": [],
}

# Toggleprompt
toggleprompt_offset_right = 45 # This controls the position of the prompt (>>>) for the conversion gallery
toggleprompt_default_hidden = "true"

# Copybutton
copybutton_exclude = '.linenos, .gp' # This avoids copying prompt (>>>) in the conversion gallery (issue #1465)

# MyST
myst_enable_extensions = [
"colon_fence", # ::: fences
"deflist", # Definition lists
"fieldlist", # Field lists
"html_admonition", # HTML-style admonitions
"html_image", # HTML images
"replacements", # Text replacements
"smartquotes", # Smart quotes
"strikethrough", # ~~strikethrough~~
"substitution", # Variable substitutions
"tasklist", # Task lists
]
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}


# --------------------------------------------------
# Extension configuration
# --------------------------------------------------
Expand Down
29 changes: 29 additions & 0 deletions docs/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""Configuration file for the doctests."""
import json
import pathlib
import typing

import pytest

import nwb2bids


# Doctest directories
@pytest.fixture(autouse=True)
def add_data_space(doctest_namespace: dict[str, typing.Any], tmp_path: pathlib.Path):
doctest_namespace["path_to_some_directory"] = pathlib.Path(tmp_path)

nwb2bids.testing.generate_ephys_tutorial(mode="file")
nwb2bids.testing.generate_ephys_tutorial(mode="dataset")

tutorial_directory = nwb2bids.testing.get_tutorial_directory() / "ephys_tutorial_file"
additional_metadata_file_path = tutorial_directory / "metadata.json"

additional_metadata = {
"dataset_description": {
"Name": "My Custom BIDS Dataset",
"BIDSVersion": "1.8.0",
"Authors": ["First Last", "Second Author"]
}
}
additional_metadata_file_path.write_text(data=json.dumps(obj=additional_metadata))
15 changes: 2 additions & 13 deletions docs/developer_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,5 @@ TODO
Documentation
-------------

The documentation is hosted on ReadTheDocs.org and can be built locally by first installing the ``docs`` group:

.. code-block:: bash

pip install -e ".[docs]"

Then, from the root of the repository, run:

.. code-block:: bash

sphinx-build -b html -W --keep-going docs ./docs/_build/

And launch the resulting ``./docs/_build/index.html`` file in your web browser.
.. include:: README.md
:parser: myst_parser.sphinx_
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
:hidden:

user_guide
tutorials
developer_guide
api/index

Expand Down
Loading