mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-21 07:02:25 +02:00
* add handling for blocks that use magic commands like %pip to convert them into bash * Apply new logic to another notebook
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" result="ansi"{% 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 -%}
|