Skip to content

Instantly share code, notes, and snippets.

@mocheng
Created July 22, 2011 12:03
Show Gist options
  • Save mocheng/1099310 to your computer and use it in GitHub Desktop.
Save mocheng/1099310 to your computer and use it in GitHub Desktop.
Customize YUIBuilder to integrate mustache
<loadfile property="component.mustache.partial" srcFile="${basedir}/mustache/partial.mu">
<filterchain>
<!-- delete blank lines, line breakers, tab character and multiple white spaces -->
<striplinebreaks/>
<tokenfilter>
<replaceregex pattern="\t" replace="" flags="gi"/>
<replaceregex pattern=" +" replace="" flags="gi"/>
<ignoreblank/>
</tokenfilter>
</filterchain>
</loadfile>
<copy file="${builddir}/files/moduletemplate.txt" tofile="@{file}" overwrite="true">
<filterset>
<filter token="CODE" value="${@{module}-@{file}-code}" />
<filter token="YUIVAR" value="${yui.variable}" />
<filter token="MODULE" value="@{module}" />
<filter token="DETAILS" value="${@{module}-details}" />
<filter token="VERSION" value="${component.version}" />
<filter token="MUSTACHE_TEMPLATE" value="${component.mustache.template}" />
</filterset>
</copy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment