Please enable JavaScript to use RhodeCode Enterprise
##// END OF EJS Templates
Matthias BUSSONNIER
- Tue, 08 Jan 2013 07:45:09
Show More
converters/template.py
0
+2
-7
@@
-87,17
+87,12
class ConverterTemplate(Configurable):
87
87
for worksheet in self . nb . worksheets :
88
88
for cell in worksheet . cells :
89
89
cell . type = cell . cell_type
90
converted_cells . append ( cell)
91
continue
92
if cell . cell_type in ( 'code' ):
93
converted_cells . append ({ 'type' : 'code' , 'source' : cell . input })
94
else :
95
converted_cells . append ({ 'type' : cell . cell_type , 'source' : python_comment ( cell . source )})
90
converted_cells . append ( worksheet )
96
91
97
92
return converted_cells
98
93
99
94
def convert ( self , cell_separator = ' \n ' ):
100
return self . template . render ( cells= self . process ())
95
return self . template . render ( worksheet s= self . process ())
101
96
102
97
103
98
def read ( self , filename ):
templates/basic.tpl
0
+3
-1
@@
-1,7
+1,8
1
1
{ %- block header -% }
2
2
{ %- endblock header -% }
3
3
{ %- block body -% }
4
{ %- for cell in cells -% }
4
{ %- for worksheet in worksheet s -% }
5
{ %- for cell in worksheet . cells -% }
5
6
{ %- block any_cell scoped -% }
6
7
{ %- if cell . type in [ 'code' ] -% }
7
8
{ %- block codecell scoped -% }
@@
-21,6
+22,7
21
22
{ %- endif -% }
22
23
{ %- endblock any_cell -% }
23
24
{ %- endfor -% }
25
{ %- endfor -% }
24
26
{ %- endblock body -% }
25
27
26
28
{ %- block footer -% }
templates/null.tpl
0
+3
-5
@@
-40,12
+40,10
consider calling super even if block is leave block, we might insert more block
40
40
{ % endblock pyerr % }
41
41
{ %- endif % }
42
42
{ %- endfor -% }
43
{ % endif % }
43
{ % endif - %}
44
{ %- endblock codecell % }
44
45
45
{ % endblock codecell % }
46
47
{ % block markdowncell scoped % }
48
{ % endblock markdowncell % }
46
{ % block markdowncell scoped % }{ % endblock markdowncell % }
49
47
50
48
{ % block headingcell scoped % }
51
49
{ % endblock headingcell % }
templates/python-armor.tpl
0
+24
-2
@@
-1,9
+1,31
1
1
{ %- extends 'python.tpl' -% }
2
2
3
{ % block any_cell % }
3
{ # % block any_cell % }
4
4
==============================
5
5
=======start {{ cell . type }} =========
6
6
{{ super () }}
7
7
======= end {{ cell . type }} =========
8
============================== { % endblock any_cell % }
8
============================== { % endblock any_cell % # }
9
10
11
12
{ % block markdowncell % } ---- Start MD ---- {{ super () }}
13
---- End MD ----
14
{ % endblock markdowncell % }
15
16
{ % block codecell % } ---- Start Code ---- {{ super () }}
17
---- End Code ----
18
{ % endblock codecell % }
19
20
{ % block headingcell scoped % } ---- Start heading ---- {{ super () }}
21
---- End heading ----
22
{ % endblock headingcell % }
23
24
{ % block rawcell scoped % } ---- Start Raw ----
25
{{ super () }}
26
---- End Raw ---- { % endblock rawcell % }
27
28
{ % block unknowncell scoped % }
29
unknown type {{ cell . type }}
30
{ % endblock unknowncell % }
9
31
templates/python.tpl
0
+2
-16
@@
-23,23
+23,9
23
23
{ % block display_data scoped % }
24
24
# image file: { % endblock display_data % }
25
25
26
{ #
27
{ % block codecell scoped % }
28
# In [ {{ cell . prompt_number if cell . prompt_number else ' ' }} ]:
29
{ % if cell . outputs % }
30
{ %- for output in cell . outputs -% }
31
{ %- if output . output_type in [ 'pyout' , 'stream' ]% }
32
33
{ %- elif output . output_type in [ 'display_data' ] % }
34
{{ "# image file: fucking display_data" }}
35
{ %- endfor -% }
36
{ % endif % }
37
38
{ % endblock codecell % }
39
# }
40
41
26
{ % block markdowncell scoped % }
42
{{ cell . source | pycomment | rm_fake}}{ % endblock markdowncell %}
27
{{ cell . source | pycomment }}
28
{ % endblock markdowncell % }
43
29
44
30
{ % block headingcell scoped % }
45
31
{{ '#' * cell . level }}{{ cell . source | pycomment }}
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
g 0-9
Goto bookmarked items from 0-9
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository access permissions settings
t s
Toggle sidebar on some pages