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 7306998
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
8 changes: 3 additions & 5 deletions nbconvert/exporters/templateexporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,7 @@ def _init_resources(self, resources):
resources["include_tableofcontents"] = self.include_tableofcontents
return resources

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

# else:
# return False


6 changes: 5 additions & 1 deletion share/templates/base/null.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ 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 %}
{{super ()}}
{% 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 7306998

Please sign in to comment.