Skip to content

Commit

Permalink
Print warning in UI when cells omitted (#1823)
Browse files Browse the repository at this point in the history
  • Loading branch information
akarve authored Oct 8, 2020
1 parent 10b7e4a commit 503d84c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lambdas/preview/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,18 @@ def extract_ipynb(file_, exclude_output: bool):
# rewind
file_.seek(0, os.SEEK_SET)

info = {}
if exclude_output:
info['warnings'] = "Omitted cell outputs to reduce notebook size"

html_exporter = HTMLExporter()
html_exporter.template_file = 'basic'
html_exporter.exclude_output = exclude_output

notebook = nbformat.read(file_, 4)
html, _ = html_exporter.from_notebook_node(notebook)

return html, {}
return html, info


def extract_vcf(head):
Expand Down

0 comments on commit 503d84c

Please sign in to comment.