##// END OF EJS Templates
allow highlighting language to be set from notebook metadata
MinRK -
Show More
@@ -115,6 +115,9 b' class Exporter(LoggingConfigurable):'
115 """
115 """
116 nb_copy = copy.deepcopy(nb)
116 nb_copy = copy.deepcopy(nb)
117 resources = self._init_resources(resources)
117 resources = self._init_resources(resources)
118
119 if 'language' in nb['metadata']:
120 resources['language'] = nb['metadata']['language'].lower()
118
121
119 # Preprocess
122 # Preprocess
120 nb_copy, resources = self._preprocess(nb_copy, resources)
123 nb_copy, resources = self._preprocess(nb_copy, resources)
@@ -41,7 +41,7 b' In [{{ cell.prompt_number }}]:'
41
41
42 {% block input %}
42 {% block input %}
43 <div class="input_area box-flex1">
43 <div class="input_area box-flex1">
44 {{ cell.input | highlight2html(metadata=cell.metadata) }}
44 {{ cell.input | highlight2html(language=resources.get('language'), metadata=cell.metadata) }}
45 </div>
45 </div>
46 {%- endblock input %}
46 {%- endblock input %}
47
47
@@ -16,6 +16,6 b''
16
16
17 ((* block input scoped *))
17 ((* block input scoped *))
18 \begin{Verbatim}[commandchars=\\\{\}]
18 \begin{Verbatim}[commandchars=\\\{\}]
19 ((( cell.input | highlight2latex(strip_verbatim=True) | add_prompts )))
19 ((( cell.input | highlight2latex(language=resources.get('language'), strip_verbatim=True) | add_prompts )))
20 \end{Verbatim}
20 \end{Verbatim}
21 ((* endblock input *))
21 ((* endblock input *))
General Comments 0
You need to be logged in to leave comments. Login now