##// END OF EJS Templates
added pygments webhelper
marcink -
r98:01d0f363 default
parent child Browse files
Show More
@@ -0,0 +1,86 b''
1 div.codeblock {
2 overflow: auto;
3 padding: 0px;
4 border: 1px solid #ccc;
5 background: #f8f8f8;
6 font-size: 100%;
7 line-height: 100%;
8 /* new */
9 line-height: 125%;
10 }
11
12 .code-highlight {
13 padding: 0px;
14 margin-top: 5px;
15 margin-bottom: 5px;
16 border-left: 2px solid #ccc;
17 }
18 .code-highlight pre, .linenodiv pre {
19 padding: 5px;
20 margin: 0;
21 }
22 .linenos a { text-decoration: none; }
23
24
25 .code { display: block; }
26 .code-highlight .hll { background-color: #ffffcc }
27 .code-highlight .c { color: #408080; font-style: italic } /* Comment */
28 .code-highlight .err { border: 1px solid #FF0000 } /* Error */
29 .code-highlight .k { color: #008000; font-weight: bold } /* Keyword */
30 .code-highlight .o { color: #666666 } /* Operator */
31 .code-highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */
32 .code-highlight .cp { color: #BC7A00 } /* Comment.Preproc */
33 .code-highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */
34 .code-highlight .cs { color: #408080; font-style: italic } /* Comment.Special */
35 .code-highlight .gd { color: #A00000 } /* Generic.Deleted */
36 .code-highlight .ge { font-style: italic } /* Generic.Emph */
37 .code-highlight .gr { color: #FF0000 } /* Generic.Error */
38 .code-highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
39 .code-highlight .gi { color: #00A000 } /* Generic.Inserted */
40 .code-highlight .go { color: #808080 } /* Generic.Output */
41 .code-highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
42 .code-highlight .gs { font-weight: bold } /* Generic.Strong */
43 .code-highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
44 .code-highlight .gt { color: #0040D0 } /* Generic.Traceback */
45 .code-highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
46 .code-highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
47 .code-highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
48 .code-highlight .kp { color: #008000 } /* Keyword.Pseudo */
49 .code-highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
50 .code-highlight .kt { color: #B00040 } /* Keyword.Type */
51 .code-highlight .m { color: #666666 } /* Literal.Number */
52 .code-highlight .s { color: #BA2121 } /* Literal.String */
53 .code-highlight .na { color: #7D9029 } /* Name.Attribute */
54 .code-highlight .nb { color: #008000 } /* Name.Builtin */
55 .code-highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
56 .code-highlight .no { color: #880000 } /* Name.Constant */
57 .code-highlight .nd { color: #AA22FF } /* Name.Decorator */
58 .code-highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
59 .code-highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
60 .code-highlight .nf { color: #0000FF } /* Name.Function */
61 .code-highlight .nl { color: #A0A000 } /* Name.Label */
62 .code-highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
63 .code-highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
64 .code-highlight .nv { color: #19177C } /* Name.Variable */
65 .code-highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
66 .code-highlight .w { color: #bbbbbb } /* Text.Whitespace */
67 .code-highlight .mf { color: #666666 } /* Literal.Number.Float */
68 .code-highlight .mh { color: #666666 } /* Literal.Number.Hex */
69 .code-highlight .mi { color: #666666 } /* Literal.Number.Integer */
70 .code-highlight .mo { color: #666666 } /* Literal.Number.Oct */
71 .code-highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
72 .code-highlight .sc { color: #BA2121 } /* Literal.String.Char */
73 .code-highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
74 .code-highlight .s2 { color: #BA2121 } /* Literal.String.Double */
75 .code-highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
76 .code-highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
77 .code-highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
78 .code-highlight .sx { color: #008000 } /* Literal.String.Other */
79 .code-highlight .sr { color: #BB6688 } /* Literal.String.Regex */
80 .code-highlight .s1 { color: #BA2121 } /* Literal.String.Single */
81 .code-highlight .ss { color: #19177C } /* Literal.String.Symbol */
82 .code-highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
83 .code-highlight .vc { color: #19177C } /* Name.Variable.Class */
84 .code-highlight .vg { color: #19177C } /* Name.Variable.Global */
85 .code-highlight .vi { color: #19177C } /* Name.Variable.Instance */
86 .code-highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
@@ -0,0 +1,491 b''
1 /*** Initial Settings ***/
2 * {
3 margin: 0;
4 padding: 0;
5 font-weight: normal;
6 font-style: normal;
7 }
8
9 html {
10 font-size: 100%;
11 font-family: sans-serif;
12 }
13
14 body {
15 font-size: 77%;
16 margin: 15px 50px;
17 background: #4B4B4C;
18 }
19
20 a {
21 color:#0000cc;
22 text-decoration: none;
23 }
24 /*** end of Initial Settings ***/
25
26
27 /** common settings **/
28 div#container {
29 background: #FFFFFF;
30 position: relative;
31 color: #666;
32 }
33
34 div.page-header {
35 padding: 50px 20px 0;
36 background: #006699 top left repeat-x;
37 position: relative;
38 }
39 div.page-header h1 {
40 margin: 10px 0 30px;
41 font-size: 1.8em;
42 font-weight: bold;
43 font-family: osaka,'MS P Gothic', Georgia, serif;
44 letter-spacing: 1px;
45 color: #DDD;
46 }
47 div.page-header h1 a {
48 font-weight: bold;
49 color: #FFF;
50 }
51 div.page-header a {
52 text-decoration: none;
53 }
54
55 div.page-header form {
56 position: absolute;
57 margin-bottom: 2px;
58 bottom: 0;
59 right: 20px;
60 }
61 div.page-header form label {
62 color: #DDD;
63 }
64 div.page-header form input {
65 padding: 2px;
66 border: solid 1px #DDD;
67 }
68 div.page-header form dl {
69 overflow: hidden;
70 }
71 div.page-header form dl dt {
72 font-size: 1.2em;
73 }
74 div.page-header form dl dt,
75 div.page-header form dl dd {
76 margin: 0 0 0 5px;
77 float: left;
78 height: 24px;
79 line-height: 20px;
80 }
81
82 ul.page-nav {
83 margin: 10px 0 0 0;
84 list-style-type: none;
85 overflow: hidden;
86 width: 800px;
87 }
88 ul.page-nav li {
89 margin: 0 2px 0 0;
90 float: left;
91 width: 80px;
92 height: 24px;
93 font-size: 1.1em;
94 line-height: 24px;
95 text-align: center;
96 }
97 ul.page-nav li.current {
98 background: #FFF;
99 }
100 ul.page-nav li a {
101 height: 24px;
102 color: #666;
103 background: #DDD;
104 display: block;
105 text-decoration: none;
106 }
107 ul.page-nav li a:hover {
108 color:#333;
109 background: #FFF;
110 }
111
112 ul.submenu {
113 margin: 10px 0 -10px 20px;
114 list-style-type: none;
115 }
116 ul.submenu li {
117 margin: 0 10px 0 0;
118 font-size: 1.2em;
119 display: inline;
120 }
121
122 h2 {
123 margin: 20px 0 10px;
124 height: 30px;
125 line-height: 30px;
126 text-indent: 20px;
127 background: #FFF;
128 font-size: 1.2em;
129 border-top: dotted 1px #D5E1E6;
130 font-weight: bold;
131 }
132 h2.no-link {
133 color:#006699;
134 }
135 h2.no-border {
136 color: #FFF;
137 background: #006699;
138 border: 0;
139 }
140 h2 a {
141 font-weight:bold;
142 color:#006699;
143 }
144
145 div.page-path {
146 text-align: right;
147 padding: 20px 30px 10px 0;
148 border:solid #d9d8d1;
149 border-width:0px 0px 1px;
150 font-size: 1.2em;
151 }
152
153 div.page-footer {
154 margin: 50px 0 0;
155 position: relative;
156 }
157 div.page-footer p {
158 position: relative;
159 left: 20px;
160 bottom: 5px;
161 font-size: 1.2em;
162 }
163
164 ul.rss-logo {
165 position: absolute;
166 top: -10px;
167 right: 20px;
168 height: 20px;
169 list-style-type: none;
170 }
171 ul.rss-logo li {
172 display: inline;
173 }
174 ul.rss-logo li a {
175 padding: 3px 6px;
176 line-height: 10px;
177 border:1px solid;
178 border-color:#fcc7a5 #7d3302 #3e1a01 #ff954e;
179 color:#ffffff;
180 background-color:#ff6600;
181 font-weight:bold;
182 font-family:sans-serif;
183 font-size:10px;
184 text-align:center;
185 text-decoration:none;
186 }
187 div.rss-logo li a:hover {
188 background-color:#ee5500;
189 }
190
191 p.normal {
192 margin: 20px 0 20px 30px;
193 font-size: 1.2em;
194 }
195
196 table {
197 margin: 10px 0 0 20px;
198 width: 95%;
199 border-collapse: collapse;
200 }
201 table tr td {
202 font-size: 1.1em;
203 }
204 table tr td.nowrap {
205 white-space: nowrap;
206 }
207 /*
208 table tr.parity0:hover,
209 table tr.parity1:hover {
210 background: #D5E1E6;
211 }
212 */
213 table tr.parity0 {
214 background: #F1F6F7;
215 }
216 table tr.parity1 {
217 background: #FFFFFF;
218 }
219 table tr td {
220 padding: 5px 5px;
221 }
222 table.annotated tr td {
223 padding: 0px 5px;
224 }
225
226 span.logtags span {
227 padding: 2px 6px;
228 font-weight: normal;
229 font-size: 11px;
230 border: 1px solid;
231 background-color: #ffaaff;
232 border-color: #ffccff #ff00ee #ff00ee #ffccff;
233 }
234 span.logtags span.tagtag {
235 background-color: #ffffaa;
236 border-color: #ffffcc #ffee00 #ffee00 #ffffcc;
237 }
238 span.logtags span.branchtag {
239 background-color: #aaffaa;
240 border-color: #ccffcc #00cc33 #00cc33 #ccffcc;
241 }
242 span.logtags span.inbranchtag {
243 background-color: #d5dde6;
244 border-color: #e3ecf4 #9398f4 #9398f4 #e3ecf4;
245 }
246
247 div.diff pre {
248 margin: 10px 0 0 0;
249 }
250 div.diff pre span {
251 font-family: monospace;
252 white-space: pre;
253 font-size: 1.2em;
254 padding: 3px 0;
255 }
256 td.source {
257 white-space: pre;
258 font-family: monospace;
259 margin: 10px 30px 0;
260 font-size: 1.2em;
261 font-family: monospace;
262 }
263 div.source div.parity0,
264 div.source div.parity1 {
265 padding: 1px;
266 font-size: 1.2em;
267 }
268 div.source div.parity0 {
269 background: #F1F6F7;
270 }
271 div.source div.parity1 {
272 background: #FFFFFF;
273 }
274 div.parity0:hover,
275 div.parity1:hover {
276 background: #D5E1E6;
277 }
278 .linenr {
279 color: #999;
280 text-align: right;
281 }
282 .lineno {
283 text-align: right;
284 }
285 .lineno a {
286 color: #999;
287 }
288 td.linenr {
289 width: 60px;
290 }
291
292 div#powered-by {
293 position: absolute;
294 width: 75px;
295 top: 15px;
296 right: 20px;
297 font-size: 1.2em;
298 }
299 div#powered-by a {
300 color: #EEE;
301 text-decoration: none;
302 }
303 div#powered-by a:hover {
304 text-decoration: underline;
305 }
306 /*
307 div#monoblue-corner-top-left {
308 position: absolute;
309 top: 0;
310 left: 0;
311 width: 10px;
312 height: 10px;
313 background: url(./monoblue-corner.png) top left no-repeat !important;
314 background: none;
315 }
316 div#monoblue-corner-top-right {
317 position: absolute;
318 top: 0;
319 right: 0;
320 width: 10px;
321 height: 10px;
322 background: url(./monoblue-corner.png) top right no-repeat !important;
323 background: none;
324 }
325 div#monoblue-corner-bottom-left {
326 position: absolute;
327 bottom: 0;
328 left: 0;
329 width: 10px;
330 height: 10px;
331 background: url(./monoblue-corner.png) bottom left no-repeat !important;
332 background: none;
333 }
334 div#monoblue-corner-bottom-right {
335 position: absolute;
336 bottom: 0;
337 right: 0;
338 width: 10px;
339 height: 10px;
340 background: url(./monoblue-corner.png) bottom right no-repeat !important;
341 background: none;
342 }
343 */
344 /** end of common settings **/
345
346 /** summary **/
347 dl.overview {
348 margin: 0 0 0 30px;
349 font-size: 1.1em;
350 overflow: hidden;
351 }
352 dl.overview dt,
353 dl.overview dd {
354 margin: 5px 0;
355 float: left;
356 }
357 dl.overview dt {
358 clear: left;
359 font-weight: bold;
360 width: 150px;
361 }
362 /** end of summary **/
363
364 /** chagelog **/
365 h3.changelog {
366 margin: 20px 0 5px 30px;
367 padding: 0 0 2px;
368 font-size: 1.4em;
369 border-bottom: dotted 1px #D5E1E6;
370 }
371 ul.changelog-entry {
372 margin: 0 0 10px 30px;
373 list-style-type: none;
374 position: relative;
375 }
376 ul.changelog-entry li span.revdate {
377 font-size: 1.1em;
378 }
379 ul.changelog-entry li.age {
380 position: absolute;
381 top: -25px;
382 right: 10px;
383 font-size: 1.4em;
384 color: #CCC;
385 font-weight: bold;
386 font-style: italic;
387 }
388 ul.changelog-entry li span.name {
389 font-size: 1.2em;
390 font-weight: bold;
391 }
392 ul.changelog-entry li.description {
393 margin: 10px 0 0;
394 font-size: 1.1em;
395 }
396 /** end of changelog **/
397
398 /** file **/
399 p.files {
400 margin: 0 0 0 20px;
401 font-size: 2.0em;
402 font-weight: bold;
403 }
404 /** end of file **/
405
406 /** changeset **/
407 h3.changeset {
408 margin: 20px 0 5px 20px;
409 padding: 0 0 2px;
410 font-size: 1.6em;
411 border-bottom: dotted 1px #D5E1E6;
412 }
413 p.changeset-age {
414 position: relative;
415 }
416 p.changeset-age span {
417 position: absolute;
418 top: -25px;
419 right: 10px;
420 font-size: 1.4em;
421 color: #CCC;
422 font-weight: bold;
423 font-style: italic;
424 }
425 p.description {
426 margin: 10px 30px 0 30px;
427 padding: 10px;
428 border: solid 1px #CCC;
429 font-size: 1.2em;
430 }
431 /** end of changeset **/
432
433 /** canvas **/
434 div#wrapper {
435 position: relative;
436 font-size: 1.2em;
437 }
438
439 canvas {
440 position: absolute;
441 z-index: 5;
442 top: -0.7em;
443 }
444
445 ul#nodebgs li.parity0 {
446 background: #F1F6F7;
447 }
448
449 ul#nodebgs li.parity1 {
450 background: #FFFFFF;
451 }
452
453 ul#graphnodes {
454 position: absolute;
455 z-index: 10;
456 top: 7px;
457 list-style: none inside none;
458 }
459
460 ul#nodebgs {
461 list-style: none inside none;
462 }
463
464 ul#graphnodes li, ul#nodebgs li {
465 height: 39px;
466 }
467
468 ul#graphnodes li .info {
469 display: block;
470 position: relative;
471 }
472 /** end of canvas **/
473
474 .browser-file {
475 background-image:url("/images/file.png");
476 background-repeat:no-repeat;
477 display:block;
478 height:16px;
479 padding-left:20px;
480 padding-top:5px;
481 text-align:left;
482 }
483 .browser-dir {
484 background-image:url("/images/folder.png");
485 background-repeat:no-repeat;
486 display:block;
487 height:16px;
488 padding-left:20px;
489 padding-top:5px;
490 text-align:left;
491 } No newline at end of file
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -6,6 +6,7 b' available to Controllers. This module is'
6 from pylons import url
6 from pylons import url
7 from pylons.i18n.translation import _, ungettext
7 from pylons.i18n.translation import _, ungettext
8 from webhelpers.html import (literal, HTML, escape)
8 from webhelpers.html import (literal, HTML, escape)
9 from webhelpers.html.builder import make_tag
9 from webhelpers.html.tools import (auto_link, button_to, highlight, js_obfuscate
10 from webhelpers.html.tools import (auto_link, button_to, highlight, js_obfuscate
10 , mail_to, strip_links, strip_tags, tag_re)
11 , mail_to, strip_links, strip_tags, tag_re)
11 from webhelpers.html.tags import (auto_discovery_link, checkbox, css_classes,
12 from webhelpers.html.tags import (auto_discovery_link, checkbox, css_classes,
@@ -22,6 +23,11 b' from webhelpers.text import (chop_at, co'
22 from webhelpers.pylonslib import Flash as _Flash
23 from webhelpers.pylonslib import Flash as _Flash
23 from webhelpers.pylonslib.secure_form import secure_form
24 from webhelpers.pylonslib.secure_form import secure_form
24
25
26 from pygments import highlight
27 from pygments.formatters import HtmlFormatter
28 from pygments.lexers import guess_lexer
29 from pygments.lexers import get_lexer_by_name
30
25 #Custom helper here :)
31 #Custom helper here :)
26 class _Link(object):
32 class _Link(object):
27 '''
33 '''
@@ -44,7 +50,7 b' class _GetError(object):'
44 if form_errors and form_errors.has_key(field_name):
50 if form_errors and form_errors.has_key(field_name):
45 return literal(tmpl % form_errors.get(field_name))
51 return literal(tmpl % form_errors.get(field_name))
46
52
47 class _FileSizeFormat():
53 class _FileSizeFormat(object):
48 """
54 """
49 Formats the value like a 'human-readable' file size (i.e. 13 KB, 4.1 MB,
55 Formats the value like a 'human-readable' file size (i.e. 13 KB, 4.1 MB,
50 102 bytes, etc).
56 102 bytes, etc).
@@ -64,6 +70,15 b' class _FileSizeFormat():'
64 return _("%.1f GB") % (bytes / (1024 * 1024 * 1024))
70 return _("%.1f GB") % (bytes / (1024 * 1024 * 1024))
65
71
66
72
73
74 def pygmentize(code, **kwargs):
75 '''
76 Filter for chunks of html to replace code tags with pygmented code
77 '''
78 return literal(highlight(code, guess_lexer(code), HtmlFormatter(**kwargs)))
79
80
81
67 filesizeformat = _FileSizeFormat()
82 filesizeformat = _FileSizeFormat()
68 link = _Link()
83 link = _Link()
69 flash = _Flash()
84 flash = _Flash()
@@ -4,8 +4,8 b''
4 <head>
4 <head>
5 <link rel="icon" href="${c.staticurl}hgicon.png" type="image/png" />
5 <link rel="icon" href="${c.staticurl}hgicon.png" type="image/png" />
6 <meta name="robots" content="index, nofollow"/>
6 <meta name="robots" content="index, nofollow"/>
7 <link rel="stylesheet" href="${c.staticurl}style-monoblue.css" type="text/css" />
7 <title>${next.title()}</title>
8 <title>${next.title()}</title>
8 ${self.css()}
9 ${self.js()}
9 ${self.js()}
10 </head>
10 </head>
11
11
@@ -83,7 +83,9 b''
83 </ul>
83 </ul>
84 </%def>
84 </%def>
85
85
86
86 <%def name="css()">
87 <link rel="stylesheet" href="/css/style-monoblue_custom.css" type="text/css" />
88 </%def>
87
89
88 <%def name="js()">
90 <%def name="js()">
89 <script type="text/javascript" src="/js/yui/utilities/utilities.js"></script>
91 <script type="text/javascript" src="/js/yui/utilities/utilities.js"></script>
General Comments 0
You need to be logged in to leave comments. Login now