Skip to content

Commit

Permalink
Updates jinja template.
Browse files Browse the repository at this point in the history
  • Loading branch information
HaudinFlorence committed Sep 16, 2024
1 parent e364a11 commit d987905
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
7 changes: 2 additions & 5 deletions nbconvert/exporters/templateexporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,8 +684,5 @@ def _init_resources(self, resources):
return resources

def include_tableofcontents(self, resources):
# if len(resources["tableofcontents"])>0:
return True

# else:
# return False
return True

5 changes: 4 additions & 1 deletion share/templates/base/null.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ calling super.
consider calling super even if it is a leaf block, we might insert more blocks later.
#}
{%- block header -%}
{%- endblock header -%}
{%- block body -%}
{%- block body_header -%}
<div>{{"Hello \n\"World\""}}</div>
{% block tableofcontents %}
{% endblock tableofcontents %}
{%- endblock body_header -%}
{%- block body_loop -%}
{%- for cell in nb.cells -%}
Expand Down
5 changes: 3 additions & 2 deletions share/templates/lab/base.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
{% from 'cell_id_anchor.j2' import cell_id_anchor %}

{% block tableofcontents %}
<div> {{"Table of contents"}} </div>

<div> {{"Table of contents"}}
{{ super() }}
</div>
{% endblock tableofcontents %}

{% block codecell %}
Expand Down

0 comments on commit d987905

Please sign in to comment.