Skip to content

Commit

Permalink
Debug auto_example doc building ... ...
Browse files Browse the repository at this point in the history
  • Loading branch information
lmcinnes committed Oct 12, 2024
1 parent 9bfc79f commit 6d6d229
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"nbsphinx",
"sphinx.ext.mathjax",
"sphinx_gallery.gen_gallery",
"sphinx_build_compatibility.extension",
# "sphinx_build_compatibility.extension",
]

# this is needed for some reason...
Expand Down
6 changes: 5 additions & 1 deletion doc/unmangle_notebook_srcdoc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import glob
import html
import shutil

_ORIGINAL_NON_INLINE_WORKER = """
const parsingWorkerBlob = new Blob([`
Expand Down Expand Up @@ -94,7 +95,7 @@
`], { type: 'application/javascript' });
"""

def unmangle_notebook_srcdoc(html_str):
def unmangle_notebook_srcdoc(html_str, auto_example=False):
new_html_str = html_str.replace(
html.escape(_NOTEBOOK_NON_INLINE_WORKER),
html.escape(_ORIGINAL_NON_INLINE_WORKER),
Expand All @@ -103,6 +104,9 @@ def unmangle_notebook_srcdoc(html_str):

def process_html_files():
print(f"Processing HTML files from {os.getcwd()}")
for zipfile in glob.glob(os.environ["READTHEDOCS_OUTPUT"] + "html/*gallery*.zip"):
print(f"Moving {zipfile} to {zipfile.replace('html/', 'html/auto_examples/')}")
shutil.copy(zipfile, zipfile.replace("html/", "html/auto_examples/"))
for filename in glob.glob(os.environ["READTHEDOCS_OUTPUT"] + 'html/**/*.html', recursive=True):
with open(filename, 'r') as f:
html_str = f.read()
Expand Down
1 change: 1 addition & 0 deletions examples/plot_interactive_arxiv_ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@
enable_search=True,
darkmode=True,
inline_data=False,
file_prefix="arxivml_gallery",
)
plot
2 changes: 2 additions & 0 deletions examples/plot_interactive_cord19.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
noise_color="#aaaaaa66",
cluster_boundary_polygons=True,
enable_search=True,
inline_data=False,
file_prefix="cord_gallery",
)
plot.save("cord19.html")
plot
2 changes: 2 additions & 0 deletions examples/plot_interactive_custom_cord19.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,5 +164,7 @@
custom_css=custom_css,
custom_html=custom_html,
custom_js=custom_js,
inline_data=False,
file_prefix="custom_cord_gallery",
)
plot
2 changes: 2 additions & 0 deletions examples/plot_interactive_wikipedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@
marker_size_array=wikipedia_marker_size_array,
cluster_boundary_polygons=True,
initial_zoom_fraction=0.99,
inline_data=False,
file_prefix="wikipedia_gallery",
)
plot

0 comments on commit 6d6d229

Please sign in to comment.