Python Pylons WebHelper Textile形式の文字列をHTMLに変換する(h.textilize) |
webhelpers.rails.text
Textileとは
http://hobix.com/textile/
HTMLのタグを簡単な表現で置き換える方法かな?
初めて知りました。
使い方はこんな感じ
${h.textilize('h1. This is a test of textile\n\nParagraph\n\nAnother paragraph\n\n* Bullets')}
出力されるHTMLはこうなります。
<h1>This is a test of textile</h1>
<p>Paragraph</p>
<p>Another paragraph</p>
<ul>
<li>Bullets</li>
</ul>
utf8な文字列を渡したら、エラーになりました・・・
日本語サイトでは、あまり使う機会はなさそうです。