mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-20 06:35:46 +02:00
* Add ast parsing to determine whether we should include result="ansi". It's not meant to be perfect, but will hopefully catch the most common cases. Still requires manual review. * Ideally we could suppress output in markdown-exec in the future.
39 lines
1.1 KiB
Django/Jinja
39 lines
1.1 KiB
Django/Jinja
{#https://github.com/rdbisme/nbconvert/blob/master/share/jupyter/nbconvert/templates/markdown/index.md.j2#}
|
|
{% extends 'markdown/index.md.j2' %}
|
|
|
|
{% block input %}
|
|
```
|
|
{%- if 'magics_language' in cell.metadata -%}
|
|
{{ cell.metadata.magics_language}}
|
|
{%- elif cell.metadata.get('language') == "shell" -%}
|
|
shell
|
|
{%- elif 'name' in nb.metadata.get('language_info', {}) -%}
|
|
{{ nb.metadata.language_info.name }}{% if cell.metadata.exec|default(false) %} exec="on" source="above" session="1"{% if cell.metadata.has_output|default(false) %} result="ansi"{% endif %}{% endif %}
|
|
{%- endif %}
|
|
{{ cell.source}}
|
|
```
|
|
{% endblock input %}
|
|
|
|
{%- block traceback_line -%}
|
|
{%- endblock traceback_line -%}
|
|
|
|
{%- block stream -%}
|
|
{%- endblock stream -%}
|
|
|
|
{%- block data_text scoped -%}
|
|
{%- endblock data_text -%}
|
|
|
|
{%- block data_html scoped -%}
|
|
```html
|
|
{{ output.data['text/html'] | safe }}
|
|
```
|
|
{%- endblock data_html -%}
|
|
|
|
{%- block data_jpg scoped -%}
|
|

|
|
{%- endblock data_jpg -%}
|
|
|
|
{%- block data_png scoped -%}
|
|

|
|
{%- endblock data_png -%}
|