<?xml version="1.0" encoding="UTF-8"?>
<article>
  <body>haml &#12399;&#27083;&#36896;&#21270;&#25991;&#31456;&#12434;&#12471;&#12531;&#12503;&#12523;&#12363;&#12388;&#24375;&#21147;&#12395;&#35352;&#36848;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12427;&#12364;&#12289;
&#35079;&#25968;&#34892;&#12398;&#12487;&#12540;&#12479;&#12398;&#25201;&#12356;&#12395;&#12399;&#20197;&#19979;&#12398;&#29702;&#30001;&#12391;&#19981;&#21521;&#12365;&#12391;&#12354;&#12427;&#12290;

 * &#34892;&#25351;&#21521;&#12391;&#12354;&#12427;&#12383;&#12417;&#36969;&#20999;&#12394;&#12452;&#12531;&#12487;&#12531;&#12488;&#12398;&#35352;&#36848;&#12364;&#24375;&#35201;&#12373;&#12428;&#12427;
 * &#38929;&#24373;&#12387;&#12390;&#22475;&#12417;&#36796;&#12435;&#12391;&#12418;&#21487;&#35501;&#24615;&#12364;&#33853;&#12385;&#12390;&#20840;&#20307;&#12398;&#27083;&#36896;&#12364;&#25226;&#25569;&#12375;&#36763;&#12367;&#12394;&#12427;

&#12371;&#12428;&#12434;&#25913;&#21892;&#12377;&#12427;&#12395;&#12399;&#12289;&#12467;&#12540;&#12489;(&#27083;&#36896;&#24773;&#22577;)&#12392;&#12487;&#12540;&#12479;&#12398;&#20998;&#38626;&#12364;&#24517;&#35201;&#12395;&#12394;&#12427;&#12290;

## inline filter module

ruby&gt;&gt;
module Inline
  include Haml::Filters::Base
 
  def self.[](key)
    @@data[key.to_s] rescue nil
  end
 
  def render(str)
    @@data = Hash[*str.split(/^\s*@@\s*(\w+)\s*\n/m)[1..-1]]
    return nil
  end
end
&lt;&lt;--

&#19978;&#35352;&#12434;&#35413;&#20385;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289;
sinatra &#12398; in file template &#12398;&#12424;&#12358;&#12395;&#12487;&#12540;&#12479;&#32676;&#12434;&#31649;&#29702;&#12391;&#12365;&#12427;&#12424;&#12358;&#12395;&#12394;&#12427;&#12290;


## &#20837;&#21147;(haml)

haml&gt;&gt;
%h1 Inline Filter
.describe= Inline[:describe]
.author created by #{Inline[:author]}
 
:inline
 @@ describe
 This filter easily separates structure and data.
 You can use in-file-templates like sinatra.
 
 @@ author
 maiha@wota.jp
&lt;&lt;--


## &#20986;&#21147;(html)


html&gt;&gt;
&lt;h1&gt;Inline Filter&lt;/h1&gt;
&lt;div class='describe'&gt;
  This filter easily separates structure and data.
  You can use in-file-templates like sinatra.
&lt;/div&gt;
&lt;div class='author'&gt;created by maiha@wota.jp&lt;/div&gt;
&lt;&lt;--
</body>
  <cached-tag-list>haml inline template</cached-tag-list>
  <comments-count type="integer">0</comments-count>
  <created-at type="datetime">2009-10-20T20:59:32+00:00</created-at>
  <daily-archive-id type="integer">1279</daily-archive-id>
  <filter-type>blue_stole</filter-type>
  <id type="integer">1645</id>
  <monthly-archive-id type="integer">198</monthly-archive-id>
  <pdf-digest nil="true"></pdf-digest>
  <permalink nil="true"></permalink>
  <published-at type="datetime">2009-10-20T20:39:00+00:00</published-at>
  <secret>ff93839c-7fe4-46e6-b5ff-5f9ddb835cb5</secret>
  <title>haml &#12391; in file template</title>
  <updated-at type="datetime">2009-10-20T20:59:32+00:00</updated-at>
  <user-id type="integer">48</user-id>
</article>
