ã¿ãªããããã«ã¡ãï¼ã¿ãªããã¯ãã³ãã¬ã¼ã使ã£ã¦ã¾ããï¼ Xslate ã¤ãã£ã¦ã¾ããï¼ TTerse 使ã£ã¦ã¾ããï¼ä»åã¯ãã£ããããã£ã¦ãã¾ãç½ ãæãã¾ãï¼ SET ã§ä½ã£ãå¤æ°ã¯ãããã¯ã¹ã³ã¼ãã§ãã ãããã¯ã¹ã³ã¼ããªãã ãã© SET ããã¹ã³ã¼ãã®ä¸ã«ãããããã¯ã¯ã¹ã³ã¼ãã®å¯¾è±¡å¤ãªã®ã§ä»¥ä¸ã®ãã¹ãã¯åããªãã£ãããããã ã my $tx = Text::Xslate->new({ syntax => 'TTerse' }); my $ret = $tx->render_string(<<TMPL,); [% SET chin = 'kiru' -%] [% MACRO xaicron BLOCK -%] [% chin = 'kiranai' -%] [% chin -%] [% END -%] [% xaicron() -%] [% chin -%] TMPL is $ret
ç°å¸¸ç³»ã®æ¯ãèããå°ãå¤ãã¾ããã https://metacpan.org/release/Text-Xslate Xslateã§ã¯ãrender()ã¸æ¸¡ããã³ãã¬ã¼ããã©ã¡ã¼ã¿ãç»é²é¢æ°ããã®æ»ãå¤ã¯å¿ ãEncodeã¢ã¸ã¥ã¼ã«ã§ãã³ã¼ãããããã¹ãæååã§ããã¹ãã§ãããããããã³ã¼ããã¦ãªããã¤ãåã渡ããã¨ãã®æåã¯æªå®ç¾©ã§ãXS/PPãããã¯cacheã®æç¡ã«ãã£ã¦æåãç°ãªã£ã¦ãã¾ãããç¹ã«cacheã®æç¡ã§æåãå¤ãããã¨ãããã®ãåä»ã§ãç¹å®ã®æ¡ä»¶ãéãªãã¨ãªãã¼ãããã¨æååãããã¨ããæåã示ããã¨ãããã¾ããã Xslateã«éãããPerlã§ã¯ã¹ã¯ãªããå ã®ããã¹ãã®æä½ã¯ãã³ã¼ããããããã¹ãæååã§è¡ãã¹ãã§ããããå®ããªããã°æååããå¼ãèµ·ããã¾ãããã£ã¦ãXslateã§ããä¸è¨ã®ããã«ãã³ã¼ãããã¦ããªããã¤ãåãä¸ããã¨æååããèµ·ããã®ããPerlçã«
From Template-Toolkit 2 to Xslate Fuji Goro (gfx) http://github.com/gfx/ Yokohama.pm#8 2011/11/18 â+shift+F ã§å ¨ç»é¢è¡¨ç¤º èªå·±ç´¹ä» id:gfx / @__gfx__ Working at DeNA CPAN: Data::Util, Test::LeakTrace, Mouse ä¸è¡ã§ã¾ã¨ãã㨠Xslateéçºãã¦ã¾ã TTããã®éãã¯wikiã«æ¸ãã¾ã irc.perl.orgã® #xslate ã«æ¥ã¦ãã ãã Xslateã¨ã¯ Perl/XSã®ãã³ãã¬ã¼ãã¨ã³ã¸ã³ ãã³ãã¬ã¼ãã¨ã³ã¸ã³ ãããã«ã¡ã¯[% $user.name %]ããï¼ãã¿ãããªã®ãå¦çããããã°ã©ã CPANã§ã¯Template::ToolkitãHTML::Templateãæå è¿ä»£çãªãã®ã ã¨Moj
ä¹ ãã¶ãã«2æé以ä¸ãã¯ã¾ã£ãã®ã§æç´ãã¦ãå ±æãã¦ããã¾ããå ·ä½çã«ã¯ãCPANã¢ã¸ã¥ã¼ã«ã¬ã¤ãã«ãåºã¦ããText::Markdownã¨ã®é£æºã¨ãINCLUDEãããã¡ã¤ã«å ã®ã:ãã®åãæ±ãã«ã¤ãã¦ã§ãã æ¦è¦ã~Markdownã使ãçç±ã¨ãµã³ãã«ã¢ããªã®æ¦è¦~ Markdownã£ã¦ãã¾ãã¡ææ³ãããããªãããtableã¨ãdlã¨ããã¾ãã¡ããã£ã¦ãåºã¦ããªããã使ã£ã¦ããªãã£ããã ãã©ãæè¿ããMarkdownããããã£ã¦è¨ããããã¨å¢ããããããããèªåã®ããã°ãçHTMLãæ¸ãã®ã«é£½ããããä»äºã§ãHTMLã ãæ¸ã人ã«çºæ³¨ãããã®é¦¬é¹¿é¦¬é¹¿ããããWebã«ã¢ããããåæã®æç« æ¸ããªããã£ã±ãæåããMarkdownã§æ¸ãã¦ãã¾ã£ãã»ããããã¨ããçµè«ã«è³ã£ããããã§ããããã使ãæ¹ç¢ºèªãããããå¨ãã®äººã®åèãå ¼ãã¦ãMarkdownã§æ¸ããæç« ãHTMLã«å¤æããã¢ããªããã
ã¯ã¦ãªã°ã«ã¼ãã®çµäºæ¥ã2020å¹´1æ31æ¥(é)ã«æ±ºå®ãã¾ãã 以ä¸ã®ã¨ã³ããªã®éããä»å¹´æ«ãç®å¦ã«ã¯ã¦ãªã°ã«ã¼ããçµäºäºå®ã§ããæ¨ããç¥ãããã¦ããã¾ããã 2019å¹´æ«ãç®å¦ã«ãã¯ã¦ãªã°ã«ã¼ãã®æä¾ãçµäºããäºå®ã§ã - ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ ãã®ãã³ãæ£å¼ã«çµäºæ¥ã決å®ãããã¾ããã®ã§ã以ä¸ã®éãã確èªãã ããã çµäºæ¥: 2020å¹´1æ31æ¥(é) ã¨ã¯ã¹ãã¼ãå¸æç³è«æé:2020å¹´1æ31æ¥(é) çµäºæ¥ä»¥éã¯ãã¯ã¦ãªã°ã«ã¼ãã®é²è¦§ããã³æ稿ã¯è¡ãã¾ãããæ¥è¨ã®ã¨ã¯ã¹ãã¼ããå¿ è¦ãªæ¹ã¯ä»¥ä¸ã®è¨äºã«ãããã£ã¦æç¶ãããã¦ãã ããã ã¯ã¦ãªã°ã«ã¼ãã«æ稿ãããæ¥è¨ãã¼ã¿ã®ã¨ã¯ã¹ãã¼ãã«ã¤ã㦠- ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ ãå©ç¨ã®ã¿ãªãã¾ã«ã¯ãè¿·æãããããããã¾ãããã©ãããããããé¡ããããã¾ãã 2020-06-25 è¿½è¨ ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ã®ã¨ã¯ã¹ãã¼ããã¼ã¿ã¯2020å¹´2æ28
Text::Xslateãç´ æµãããï¼Markdownç·¨ï¼ 2011å¹´2æ17æ¥ 10:13 D | ããã°è¨äºã®URL | ã³ã¡ã³ã(0) | ãã©ãã¯ããã¯(0) ãããããText::Xslateç´ æµãããã ãã ä»æ¥Markdownã使ãããã¨æã£ã¦ã¡ãã£ã¨èããããããã ãã§çµäºããï¼ use strict; use Text::Xslate; my $xslate = Text::Xslate->new( .... module => [ 'Text::Markdown' => [ 'markdown' ] ] ); print $xslate->render_string( <<EOT, { text => $some_markdown_text ); [% text | markdown | mark_raw %] EOT ç´ æµï¼gfx å çã«ãªãæ±ããã¦ãããã 俺ãXS
Xslateã¯Macroã«å¯¾å¿ãã¦ããã®ã§ãããINCLUDEå ã§ã¯å©ç¨ã§ããªãã¨ããå¶ç´ãããã¾ãã ãã®å¯¾å¿ã以ä¸å®éã®ã³ã¼ãã INCLUDEå ã§ãå©ç¨ã§ããããã«ãªã£ãéã®ç§»è¡ãèæ ®ãã¦å®è£ ãã¦ãã¾ãã kazeburo++ package Golgo::Admin::View::MacroSection; use strict; use warnings; use base qw/Exporter/; use Data::Section::Simple; use Text::Xslate; our @EXPORT = qw( paginate ); my $XSLATE; __PACKAGE__->create_xslate(); sub paginate { my $args = {}; ( $args->{pager} , $args->{my_uri} ) = @_; re
Xslate 㯠XS æå¹ãªãå§åçã«é«éãPP çã¯ãã¯ã perl ã«ã³ã³ãã¤ã«ãã TMT ãå§åçã«é«éãã¨ã¯ãããPP ã§ãååãªé度ã¯ã§ã¦ããã®ã§ãæ®æ®µ XS ã§ã¤ãã£ã¦ã¦ãã©ããã¦ã PP ã¤ãããªãããããªãã¨ãã®ä»£æ¿ã¨ãã¦å©ç¨ããç¨åº¦ãªãæºè¶³ã§ããã tokuhirom@gpath% perl benchmark/others.pl [~/dev/Text-Xslate] æ¨ 5 11:55 Perl/5.12.1 x86_64-linux Text::Xslate/0.1054 Text::MicroTemplate/0.15 Template/2.22 Text::ClearSilver/0.10.5.4 HTML::Template::Pro/0.9502 1..5 ok 1 - TT: Template-Toolkit ok 2 - MT: Text::Micr
éãã¨åã® Xslate ã§ãããå®éã©ã使ãã®ãã¨ããç¹ã§ã¯ã¾ã ã¾ã ææåããããã®ãå°ãªãã¨æã£ãã®ã§ http://xslate.org/intro.html ãæ¸ãã¦ããã¾ããã è¨äºã§ã¯ãã¤ãã¬ã¼ã·ã§ã³ãã¯ãããç¥ã£ã¦ããã¨ä¾¿å©ãª dump ãã£ã«ã¿ã mark_raw() ããã¼ãã«ãªã£ã¦ãã¾ãã è¿ã ããããã¼ã¸ãããªã³ã¯ããã模æ§ã ãµã³ãã«ã³ã¼ã㯠id:gfx ããã®æãå ¥ã£ã¦ããã®ã§å®å¿ã®ã¯ã©ãªãã£ã ãµã³ãã«ãè¦ãã°ç¹ã«è±èªèªä½ã¯èªã¾ãªãã¦ã大ä¸å¤«ã§ãã åè - ãããããéããï¼
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}