-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d046ff
commit 4f40d68
Showing
16 changed files
with
417 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""Extension to patch https://github.com/executablebooks/MyST-NB/pull/599.""" | ||
|
||
# TODO once MyST-NB 1.1.1/1.2.0 is out, this can be removed. | ||
|
||
from __future__ import annotations | ||
|
||
from copy import copy | ||
from typing import TYPE_CHECKING | ||
|
||
from myst_nb.core.render import MditRenderMixin | ||
|
||
if TYPE_CHECKING: | ||
from sphinx.application import Sphinx | ||
|
||
|
||
get_orig = MditRenderMixin.get_cell_level_config | ||
|
||
|
||
def get_cell_level_config( | ||
self: MditRenderMixin, | ||
field: str, | ||
cell_metadata: dict[str, object], | ||
line: int | None = None, | ||
): | ||
rv = get_orig(self, field, cell_metadata, line) | ||
return copy(rv) | ||
|
||
|
||
def setup(app: Sphinx): | ||
MditRenderMixin.get_cell_level_config = get_cell_level_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.