null.tpl
60 lines
| 2.0 KiB
| application/vnd.groove-tool-template
|
SmartyLexer
Matthias BUSSONNIER
|
r9583 | {# | ||
Jonathan Frederic
|
r12658 | DO NOT USE THIS AS A BASE, | ||
Matthias BUSSONNIER
|
r9588 | IF YOU ARE COPY AND PASTING THIS FILE | ||
Jonathan Frederic
|
r12658 | YOU ARE PROBABLY DOING THINGS INCORRECTLY. | ||
Matthias BUSSONNIER
|
r9588 | |||
Jonathan Frederic
|
r12658 | Null template, does nothing except defining a basic structure | ||
MinRK
|
r10041 | To layout the different blocks of a notebook. | ||
Matthias BUSSONNIER
|
r9583 | |||
MinRK
|
r10041 | Subtemplates can override blocks to define their custom representation. | ||
Matthias BUSSONNIER
|
r9583 | |||
MinRK
|
r10041 | If one of the block you do overwrite is not a leave block, consider | ||
Matthias BUSSONNIER
|
r9583 | calling super. | ||
Matthias BUSSONNIER
|
r9587 | {%- block nonLeaveBlock -%} | ||
Matthias BUSSONNIER
|
r9583 | #add stuff at beginning | ||
{{ super() }} | ||||
#add stuff at end | ||||
Matthias BUSSONNIER
|
r9587 | {%- endblock nonLeaveBlock -%} | ||
Matthias BUSSONNIER
|
r9583 | |||
MinRK
|
r10041 | consider calling super even if it is a leave block, we might insert more blocks later. | ||
Matthias BUSSONNIER
|
r9583 | |||
#} | ||||
Matthias BUSSONNIER
|
r9588 | {%- block header -%} | ||
{%- endblock header -%} | ||||
{%- block body -%} | ||||
Matthias BUSSONNIER
|
r9604 | {%- for worksheet in nb.worksheets -%} | ||
Matthias BUSSONNIER
|
r9588 | {%- for cell in worksheet.cells -%} | ||
{%- block any_cell scoped -%} | ||||
Jonathan Frederic
|
r10630 | {%- if cell.cell_type in ['code'] -%} | ||
Matthias BUSSONNIER
|
r9588 | {%- block codecell scoped -%} | ||
Matthias BUSSONNIER
|
r9590 | {%- block input_group -%} | ||
Jonathan Frederic
|
r12657 | {%- include 'cell_input.tpl' -%} | ||
Matthias BUSSONNIER
|
r9590 | {%- endblock input_group -%} | ||
MinRK
|
r10041 | {%- if cell.outputs -%} | ||
Matthias BUSSONNIER
|
r9591 | {%- block output_group -%} | ||
Jonathan Frederic
|
r12657 | {%- include 'cell_outputs.tpl' -%} | ||
Matthias BUSSONNIER
|
r9590 | {%- endblock output_group -%} | ||
MinRK
|
r10041 | {%- endif -%} | ||
Matthias BUSSONNIER
|
r9588 | {%- endblock codecell -%} | ||
Jonathan Frederic
|
r10630 | {%- elif cell.cell_type in ['markdown'] -%} | ||
Matthias BUSSONNIER
|
r9588 | {%- block markdowncell scoped-%} | ||
{%- endblock markdowncell -%} | ||||
Jonathan Frederic
|
r10630 | {%- elif cell.cell_type in ['heading'] -%} | ||
Matthias BUSSONNIER
|
r9588 | {%- block headingcell scoped-%} | ||
{%- endblock headingcell -%} | ||||
Jonathan Frederic
|
r10630 | {%- elif cell.cell_type in ['raw'] -%} | ||
Matthias BUSSONNIER
|
r9588 | {%- block rawcell scoped-%} | ||
{%- endblock rawcell -%} | ||||
{%- else -%} | ||||
{%- block unknowncell scoped-%} | ||||
{%- endblock unknowncell -%} | ||||
{%- endif -%} | ||||
{%- endblock any_cell -%} | ||||
{%- endfor -%} | ||||
Matthias BUSSONNIER
|
r9580 | {%- endfor -%} | ||
Matthias BUSSONNIER
|
r9588 | {%- endblock body -%} | ||
Matthias BUSSONNIER
|
r9580 | |||
Matthias BUSSONNIER
|
r9588 | {%- block footer -%} | ||
{%- endblock footer -%} | ||||