Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark2000 committed May 30, 2024
1 parent 9a55321 commit a9be079
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,18 @@ def run(self, source_dir=None):
nb_cache_dir = Path("../build/doctrees/nbsphinx") # relative to build
for notebook in nb_paths:
nb_cache = nb_cache_dir / self.base_doc_dir / index_path / notebook.name

print()
print(notebook)
print("cache at", nb_cache, nb_cache.is_file())
print(
"diff",
diff_notebooks(
read_notebook(notebook, on_null="empty"),
read_notebook(nb_cache, on_null="empty"),
),
)

if (
nb_cache.is_file()
and "'key': 'source'"
Expand All @@ -293,11 +305,13 @@ def run(self, source_dir=None):
read_notebook(nb_cache, on_null="empty"),
).__repr__()
):
print("COPYING CACHE")
shutil.copy(
nb_cache,
self.base_doc_dir / index_path / notebook.name,
)
else:
print("COPYING NOTEBOOK")
shutil.copy(notebook, self.base_doc_dir / index_path / notebook.name)

# Recursively go through all directories in source, documenting what is available.
Expand All @@ -312,4 +326,3 @@ def run(self, source_dir=None):
sys.path.append(os.path.abspath("../.."))
PackageCrawler(Path("../../src/bsk_rl/"), Path("./api_reference/")).run()
PackageCrawler(Path("../../examples"), Path("./examples/"), filter_all=False).run()
import nbdime

0 comments on commit a9be079

Please sign in to comment.