Skip to content

Commit cfa0879

Browse files
committed
add deprecation warning
1 parent 75b003f commit cfa0879

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

jupyter_sphinx/ast.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Manipulating the Sphinx AST with Jupyter objects"""
22

33
import json
4+
import warnings
45
from pathlib import Path
56

67
import docutils
@@ -588,7 +589,13 @@ def apply_styling(node, thebe_config):
588589
class JupyterDownloadRole(ReferenceRole):
589590
def run(self):
590591
sep = ":" if ":" in self.name else "-"
591-
_, filetype = self.name.rsplit(sep, maxsplit=1)
592+
name, filetype = self.name.rsplit(sep, maxsplit=1)
593+
if sep == ":":
594+
warnings.warn(
595+
f"The {self.name} syntax is deprecated and "
596+
f"will be removed in 0.5.0, please use {name}-{filetype}",
597+
category=DeprecationWarning,
598+
)
592599

593600
assert filetype in ("notebook", "nb", "script")
594601
ext = ".ipynb" if filetype in ("notebook", "nb") else ".py"

0 commit comments

Comments
 (0)