You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
ãã®ããã°ã¯Jadeã使ãããã£ãã¨ããçµç·¯ããhamlish-jinjaã使ã£ã¦ãããã ãã©ãpyjadeãåºæ¥ã¦ãã®ã§ä¸¡æ¹ã§æ¸ãã¦ã¿ãã å·¦ãjadeã§å³ãhamilish jadeã¯hamlishã¨éã£ã¦%ã¨ã-ã¿ãããªè¨å·ããããªãã¦ãNode.jsã®jadeã¨åãããã«æ¸ããããJinjaã®ã¿ã°ãèªç¶ãªæãã§ç´æçã«ãããã®ã§ããã£ã±Jadeã®ã»ãã好ã¿ããªã ãã ãurl_forã§single quoteã¨double quoteã®ä½¿ãåãã§ã¯ã¾ã£ãã a.title(href="{{ url_for('show_entries', entry=entry.perma, _external=True) }}")
Today I wrote a little Django to Jinja2 template converter. While it can translate most of the builtin template tags into Jinja constructs it doesn't fully automate the process because you have to extend it for your own custom tags and it doesn't adapt your templates to the changed semantics.And these differences in semantics (and the underlying architecture) are something I want to discuss a bit
>>> from django.template import Lexer, StringOrigin >>> origin = StringOrigin("Hello {{ name|upper }}!") >>> for token in Lexer(origin.source, origin).tokenize(): ... print token ... <Text token: "Hello ..."> <Var token: "name|upper..."> <Text token: "!..."> So as you can see, whereas Jinja creates very tiny bits of the input string, Django only distinguishes between four different kinds of token
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}