parsing - Emmet Parser for PHP -



parsing - Emmet Parser for PHP -

is there php parser take emmet style markdown code , parse html?

i find myself writing code like.

$htmlblock .= '<div id="'.$mydivid.'">'; $htmlblock .= '<ul>'; foreach( $myarray $listitem){ $htmlblock .= '<li>' . $listitem . '</li>'; } $htmlblock .= '</ul>'; $htmlblock .= '</div>'; echo $htmlblock;

with nesting, conditions, attributes, , classes gets tedious , complicated. worst part remembering close tags , calculating when tag needs closed.

i familiar heredoc gets pretty messy nested loops , conditionals. avoid tags , html syntax entirely. if fact, sense crazy writing it.

those familiar emmet know

#page>div.logo+ul#navigation>li*5>a{item $}

will parse into

<div id="page"> <div class="logo"></div> <ul id="navigation"> <li><a href="">item 1</a></li> <li><a href="">item 2</a></li> <li><a href="">item 3</a></li> <li><a href="">item 4</a></li> <li><a href="">item 5</a></li> </ul>

it much easier write

$emmet = #$mydivid ul li{$myarray}

even beingness able write pretty sweet.

$emmet = #$mydivid ul $emmet .= foreach ($myarray $listitem) li{$listitem}

i see lot of markdown parsers php, , parsedown looks cool, don't want have larn language. outputting html in shorthand syntax.

it seems stylus, sass, , less tackled problem in css, html forgotten. amazing me because html much more verbose.

i sense ideal solutions php emmet parser allows variables. know of one? if not, start github repo , go work.

i've found 2 projects right focus, 1 never got started.

https://github.com/lavoiesl/php-emmet

this 1 trick. explore it.

https://code.google.com/p/php-zen-coding/wiki/overviewusage

php parsing handlebars.js markdown emmet

Comments

Popular posts from this blog

java Multi query from Mysql using netbeans -

c# - DotNetZip fails with "stream does not support seek operations" -

c++ - StartServiceCtrlDispatcher don't can access 1063 error -