Skip to content

Commit

Permalink
Add a docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu committed Oct 31, 2024
1 parent 5e56b7a commit 7db4fd8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/sage_docbuild/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,9 +919,17 @@ class will be properly documented inside its surrounding class.
return skip

def clean_jupyter_execute(app, exception):
jupyter_execute_path = os.path.join(app.outdir, 'jupyter_execute')
if os.path.exists(jupyter_execute_path):
shutil.rmtree(jupyter_execute_path)
"""
If there was no exception during the doc build, we remove the useless
``jupyter_execute`` directory, which would only bloat the doc tree.
If there was an exception, the ``jupyter_execute`` directory may be useful
for debugging and hence we don't remove it.
"""
if exception is None: # only proceed if there were no build errors
jupyter_execute_path = os.path.join(app.outdir, 'jupyter_execute')
if os.path.exists(jupyter_execute_path):
shutil.rmtree(jupyter_execute_path)


class SagecodeTransform(SphinxTransform):
Expand Down

0 comments on commit 7db4fd8

Please sign in to comment.