pyhaml.Pythonic Haml. | |
Áö±Ý ´Ù¿î·Îµå |
pyhaml. ¼øÀ§ ¹× ¿ä¾à
±¤°í
pyhaml. ű×
pyhaml. ¼³¸í
Pythonic Haml. PyHamlÀº Python ¿ë HAMLÀÇ ±¸ÇöÀÔ´Ï´Ù .Developer Commentsi´Â ³»°¡ ÇÒ ¼öÀÖ´Â °Í°ú µ¿ÀÏÇÑ ±¸¹®À» ¸¹ÀÌ º¸°üÇßÁö¸¸, ´Ü¼øÈ÷ º¹Á¦ ÇÒ ¼ö¾ø´Â Haml¿¡ ³»Àå µÈ ·ç¸¶½º°¡ Á¦À۵Ǿú½À´Ï´Ù. Àú´Â PythonicÀ̵ǵµ·Ï ÀûÀÀÇÏ´Â µ¿½Ã¿¡ ¿ø·¡ÀÇ ±â´É¿¡ Ãæ½ÇÇÏÁö ¾ÊÀ¸·Á°í ³ë·ÂÇß½À´Ï´Ù.ÀÌ ÆÐÅ°Áö´Â ±âº»ÀûÀ¸·Î Pyhaml Äڵ带 Mako ÅÛÇø´À¸·Î ±³Â÷ÇÕ´Ï´Ù. Ergo, ¸ðµç Ç¥ÁØ Mako ±¸¹®Àº Haml syntax.api exampleImport Hamlimport mako.template # 1À» ÀÏÄ¡½ÃÅ°Áö ¾Ê´Â ÄÜÅÙÃ÷¿¡µµ Àû¿ëµË´Ï´Ù. HAML.HAML_SOURCE = '.Content Hello, World!'# 2. ´ç½ÅÀÇ ±¸¹® ºÐ¼® haml ¼Ò½º ³ëµå tree.haml_nodes = haml.parse_string (haml_source) # 3. ³ëµå tree.mako_source = haml.generate_mako (haml_nodes) # 4. ÅÛÇø´À» ·»´õ¸µÇÕ´Ï´Ù. mako.template.template (mako_source) ) .render_unicode () Ãâ·Â :
pyhaml. °ü·Ã ¼ÒÇÁÆ®¿þ¾î