Skip to content

Commit

Permalink
limit ref substitution to md cells
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSchobben committed Aug 14, 2024
1 parent 4936822 commit f384f9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/eo_datascience/clean_nb.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def convert_refs(dir="./notebooks", save=True):
nb = nbformat.read(nb_path, as_version=4)
for i in range(len(nb.cells)):
if i != 0:
nb.cells[i].source = nb.cells[i].source.replace(r"[@", r"{cite}`").replace(r"]", r"`")
if nb.cells[i]["cell_type"] == "markdown":
nb.cells[i].source = nb.cells[i].source.replace(r"[@", r"{cite}`").replace(r"]", r"`")

# Save the notebook
if save:
Expand Down
2 changes: 1 addition & 1 deletion src/eo_datascience/render_sfinx_toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
)

with open('_toc.yml', 'w+') as ff:
yaml.dump(toc, ff)
yaml.dump(toc, ff)

0 comments on commit f384f9a

Please sign in to comment.