##// END OF EJS Templates
templater: add hex filter.
Dan Villiom Podlaski Christiansen -
r12371:48a4acd1 default
parent child Browse files
Show More
@@ -106,6 +106,9 b' List of filters:'
106 :escape: Any text. Replaces the special XML/XHTML characters "&", "<"
106 :escape: Any text. Replaces the special XML/XHTML characters "&", "<"
107 and ">" with XML entities.
107 and ">" with XML entities.
108
108
109 :hex: Any text. Convert a binary Mercurial node identifier into
110 its long hexadecimal representation.
111
109 :fill68: Any text. Wraps the text to fit in 68 columns.
112 :fill68: Any text. Wraps the text to fit in 68 columns.
110
113
111 :fill76: Any text. Wraps the text to fit in 76 columns.
114 :fill76: Any text. Wraps the text to fit in 76 columns.
@@ -6,7 +6,7 b''
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 import cgi, re, os, time, urllib
8 import cgi, re, os, time, urllib
9 import util, encoding
9 import encoding, node, util
10
10
11 def stringify(thing):
11 def stringify(thing):
12 '''turn nested template iterator into string.'''
12 '''turn nested template iterator into string.'''
@@ -216,6 +216,7 b' filters = {'
216 "person": person,
216 "person": person,
217 "rfc822date": lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S %1%2"),
217 "rfc822date": lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S %1%2"),
218 "rfc3339date": lambda x: util.datestr(x, "%Y-%m-%dT%H:%M:%S%1:%2"),
218 "rfc3339date": lambda x: util.datestr(x, "%Y-%m-%dT%H:%M:%S%1:%2"),
219 "hex": node.hex,
219 "short": lambda x: x[:12],
220 "short": lambda x: x[:12],
220 "shortdate": util.shortdate,
221 "shortdate": util.shortdate,
221 "stringify": stringify,
222 "stringify": stringify,
General Comments 0
You need to be logged in to leave comments. Login now