{%- extends 'display_priority.j2' -%} {% from 'celltags.j2' import celltags %} {% from 'cell_id_anchor.j2' import cell_id_anchor %} {% block codecell %} {%- if not cell.outputs -%} {%- set no_output_class="jp-mod-noOutputs" -%} {%- endif -%} {%- if not resources.global_content_filter.include_input -%} {%- set no_input_class="jp-mod-noInput" -%} {%- endif -%}
{{ super() }}
{%- endblock codecell %} {% block input_group -%}
{{ super() }}
{% endblock input_group %} {% block input %}
{{ cell.source | highlight_code(metadata=cell.metadata) | clean_html }}
{%- endblock input %} {% block output_group %}
{{ super() }}
{% endblock output_group %} {% block outputs %}
{{ super() }}
{% endblock outputs %} {% block in_prompt -%}
{%- if cell.execution_count is defined -%} In [{{ cell.execution_count|replace(None, " ") }}]: {%- else -%} In [ ]: {%- endif -%}
{%- endblock in_prompt %} {% block empty_in_prompt -%}
{%- endblock empty_in_prompt %} {# output_prompt doesn't do anything in HTML, because there is a prompt div in each output area (see output block) #} {% block output_prompt %} {% endblock output_prompt %} {% block output_area_prompt %}
{%- if output.output_type == 'execute_result' -%} {%- if cell.execution_count is defined -%} Out[{{ cell.execution_count|replace(None, " ") }}]: {%- else -%} Out[ ]: {%- endif -%} {%- endif -%}
{% endblock output_area_prompt %} {% block output %} {%- if output.output_type == 'execute_result' -%}
{%- else -%}
{%- endif -%} {% if resources.global_content_filter.include_output_prompt %} {{ self.output_area_prompt() }} {% endif %} {{ super() }}
{% endblock output %} {% block markdowncell scoped %}
{%- endblock markdowncell %} {% block rawcell scoped %} {%- if cell.metadata.get('raw_mimetype', '').lower() in resources.get('raw_mimetypes', ['']) -%} {{ cell.source | clean_html }} {%- endif -%} {%- endblock rawcell %} {% block unknowncell scoped %} unknown type {{ cell.type }} {% endblock unknowncell %} {% block execute_result -%} {%- set extra_class="jp-OutputArea-executeResult" -%} {% block data_priority scoped %} {{ super() }} {% endblock data_priority %} {%- set extra_class="" -%} {%- endblock execute_result %} {% block stream_stdout -%}
{{- output.text | ansi2html -}}
{%- endblock stream_stdout %} {% block stream_stderr -%}
{{- output.text | ansi2html -}}
{%- endblock stream_stderr %} {% block stream_stdin -%} {%- if resources.global_content_filter.include_output_stdin -%}
{{- output.text | ansi2html -}}
{%- endif %} {%- endblock stream_stdin %} {% block data_svg scoped -%}
{%- if output.svg_filename %} {%- else %} {%- if resources.should_not_encode_svg %} {{ output.data['image/svg+xml'].encode("utf-8") | clean_html }} {%- else %} {%- endif %} {%- endif %}
{%- endblock data_svg %} {% block data_mermaid scoped -%}
{{ output.data['text/vnd.mermaid'].strip() }}
{%- endblock data_mermaid %} {% block data_html scoped -%}
{%- if resources.should_sanitize_html %} {{ output.data['text/html'] | clean_html }} {%- else %} {{ output.data['text/html'] }} {%- endif %}
{%- endblock data_html %} {% block data_markdown scoped -%} {%- if resources.should_sanitize_html %} {%- set html_value=output.data['text/markdown'] | markdown2html | clean_html -%} {%- else %} {%- set html_value=output.data['text/markdown'] | markdown2html -%} {%- endif %}
{{ html_value }}
{%- endblock data_markdown %} {% block data_png scoped %}
{%- if 'image/png' in output.metadata.get('filenames', {}) %}
{%- endblock data_png %} {% block data_jpg scoped %}
{%- if 'image/jpeg' in output.metadata.get('filenames', {}) %}
{%- endblock data_jpg %} {% block data_latex scoped %}
{{ output.data['text/latex'] | e }}
{%- endblock data_latex %} {% block error -%}
{{- super() -}}
{%- endblock error %} {%- block traceback_line %} {{ line | ansi2html }} {%- endblock traceback_line %} {%- block data_text scoped %}
{{- output.data['text/plain'] | ansi2html -}}
{%- endblock -%} {# ############################################################################### # TODO: how to better handle JavaScript repr? # ############################################################################### #} {%- block data_javascript scoped %} {% set div_id = uuid4() %}
{%- if not resources.should_sanitize_html %} {%- endif %}
{%- endblock -%} {%- block data_widget_view scoped %} {% set div_id = uuid4() %} {% set datatype_list = output.data | filter_data_type %} {% set datatype = datatype_list[0]%}
{%- endblock data_widget_view -%} {%- block footer %} {% set mimetype = 'application/vnd.jupyter.widget-state+json'%} {% if mimetype in nb.metadata.get("widgets",{})%} {% endif %} {{ super() }} {%- endblock footer-%}