Skip to content

Commit

Permalink
compat: Sphinx 8.2.0 (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro authored Feb 20, 2025
1 parent 534ba41 commit fa920e7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nbsite/nbbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@
import typing

from contextlib import contextmanager
from pathlib import Path

import nbformat
import sphinx

from docutils.parsers.rst import Directive, directives
from docutils.statemachine import string2lines
Expand All @@ -52,6 +54,7 @@
from nbconvert.preprocessors import (
CellExecutionError, ExecutePreprocessor, Preprocessor,
)
from packaging.version import Version
from sphinx.util import logging

from .cmd import _prepare_paths, hosts
Expand Down Expand Up @@ -476,6 +479,9 @@ def patch_project_doc2path(env, nb_path):
# absolute notebook path.
old_doc2path = env.project.doc2path

if Version(sphinx.__version__).release >= (8, 2, 0):
nb_path = Path(nb_path)

def new_doc2path(docname: str, absolute: bool):
return nb_path

Expand Down

0 comments on commit fa920e7

Please sign in to comment.