##// END OF EJS Templates
handle unicode/str in pretty, str formatter...
handle unicode/str in pretty, str formatter by casting str to unicode on Python 2

File last commit:

r18589:135227ac
r20486:fe14d514
Show More
style_bw_ipython.tplx
45 lines | 1.5 KiB | text/plain | TextLexer
Jonathan Frederic
Added black and white ipython style
r12711 ((= Black&white ipython input/output style =))
Thomas Kluyver
Remove magic for loading templates from module names
r13925 ((*- extends 'base.tplx' -*))
Jonathan Frederic
Added black and white ipython style
r12711
%===============================================================================
% Input
%===============================================================================
((* block input scoped *))
MinRK
update nbconvert to nbformat 4
r18580 ((( add_prompt(cell.source, cell, 'In ') )))
Jonathan Frederic
Added black and white ipython style
r12711 ((* endblock input *))
%===============================================================================
% Output
%===============================================================================
MinRK
update nbconvert to nbformat 4
r18580 ((* block execute_result scoped *))
MinRK
move mime-bundle data to rich output.data...
r18589 ((*- for type in output.data | filter_data_type -*))
((*- if type in ['text/plain']*))
((( add_prompt(output.data['text/plain'], cell, 'Out') )))
Jonathan Frederic
Added black and white ipython style
r12711 ((*- else -*))
MinRK
s/prompt_number/execution_count in nbformat 4
r18587 \verb+Out[((( cell.execution_count )))]:+((( super() )))
Jonathan Frederic
Added black and white ipython style
r12711 ((*- endif -*))
((*- endfor -*))
MinRK
update nbconvert to nbformat 4
r18580 ((* endblock execute_result *))
Jonathan Frederic
Added black and white ipython style
r12711
%==============================================================================
% Support Macros
%==============================================================================
% Name: draw_prompt
% Purpose: Renders an output/input prompt
((* macro add_prompt(text, cell, prompt) -*))
MinRK
s/prompt_number/execution_count in nbformat 4
r18587 ((*- if cell.execution_count is defined -*))
((*- set execution_count = "" ~ (cell.execution_count | replace(None, " ")) -*))
Jessica B. Hamrick
Handle case where prompt number is not defined in latex templates
r18345 ((*- else -*))
MinRK
s/prompt_number/execution_count in nbformat 4
r18587 ((*- set execution_count = " " -*))
Jessica B. Hamrick
Handle case where prompt number is not defined in latex templates
r18345 ((*- endif -*))
MinRK
s/prompt_number/execution_count in nbformat 4
r18587 ((*- set indentation = " " * (execution_count | length + 7) -*))
Jonathan Frederic
Move verbatim into add prompt macro
r12720 \begin{verbatim}
MinRK
s/prompt_number/execution_count in nbformat 4
r18587 (((- text | add_prompts(first=prompt ~ '[' ~ execution_count ~ ']: ', cont=indentation) -)))
Jonathan Frederic
Move verbatim into add prompt macro
r12720 \end{verbatim}
Jonathan Frederic
Added black and white ipython style
r12711 ((*- endmacro *))