##// END OF EJS Templates
add js_extensions_path...
add js_extensions_path serves files in `IPYTHONDIR/js_extensions` at `/js_extensions`. This is a location for users / devs to drop-in frontend customization as js modules, css, etc. The model is very much like the extensions dir (hence the name) - it's a location made available, but not loaded by default. You can load things from there with require, etc. It's a configurable search path, just like static. This way we can define a system-wide location at a later point (/usr/share/ipython/js_extensions?) and still have user installs.

File last commit:

r12742:c74425a8
r12800:e6dfc2ae
Show More
style_ipython.tplx
54 lines | 1.8 KiB | text/plain | TextLexer
Jonathan Frederic
Fixed doc comment
r12719 ((= IPython input/output style =))
Jonathan Frederic
Add colored ipython style
r12718
((*- extends 'latex_base.tplx' -*))
% Custom definitions
((* block definitions *))
((( super() )))
% Pygments definitions
Jonathan Frederic
s/pygment/pygments
r12742 ((( resources.latex.pygments_definitions )))
Jonathan Frederic
Add colored ipython style
r12718
Jonathan Frederic
Finishing up results of in person review
r12734 % Exact colors from NB
\definecolor{incolor}{rgb}{0.0, 0.0, 0.5}
\definecolor{outcolor}{rgb}{0.545, 0.0, 0.0}
Jonathan Frederic
Add colored ipython style
r12718 ((* endblock definitions *))
%===============================================================================
% Input
%===============================================================================
((* block input scoped *))
((( add_prompt(cell.input | highlight2latex(strip_verbatim=True), cell, 'In ', 'incolor') )))
((* endblock input *))
%===============================================================================
% Output
%===============================================================================
((* block pyout scoped *))
((*- for type in output | filter_data_type -*))
((*- if type in ['text']*))
((( add_prompt(output.text | escape_latex, cell, 'Out', 'outcolor') )))
((* else -*))
Jonathan Frederic
Finishing up results of in person review
r12734 \texttt{\color{outcolor}Out[{\color{outcolor}((( cell.prompt_number )))}]:}((( super() )))
Jonathan Frederic
Add colored ipython style
r12718 ((*- endif -*))
((*- endfor -*))
((* endblock pyout *))
%==============================================================================
% Support Macros
%==============================================================================
% Name: draw_prompt
% Purpose: Renders an output/input prompt
((* macro add_prompt(text, cell, prompt, prompt_color) -*))
((*- set prompt_number = "" ~ cell.prompt_number -*))
Jonathan Frederic
Fixed, indentation broken post in person review
r12736 ((*- set indention = " " * (prompt_number | length + 7) -*))
Jonathan Frederic
Add colored ipython style
r12718 \begin{Verbatim}[commandchars=\\\{\}]
Jonathan Frederic
Fixed, indentation broken post in person review
r12736 ((( text | add_prompts(first='{\color{' ~ prompt_color ~ '}' ~ prompt ~ '[{\\color{' ~ prompt_color ~ '}' ~ prompt_number ~ '}]:} ', cont=indention) )))
Jonathan Frederic
Add colored ipython style
r12718 \end{Verbatim}
((*- endmacro *))