logo       

Macro Defs with HTML-Editor: msg#00138

jakarta.velocity.user

Subject: Macro Defs with HTML-Editor

Hi,

to be able to write VelociMacros using a HTML-WYSIWYG-editor I need a
way to extract only macro definitions from a HTML source. See the
following example:

---[ A.vm ]----------------
<good stuff 1>
#goodStuff()
<good stuff 3>
-------------------------

---[ B.vm ]----------------
<bad stuff 1>
#macro ( goodStuff )
<good stuff 2>
#end
<bad stuff 2>

#parse("A.vm")
--------------------------

Compiling B.vm will give
--------------------------
<bad stuff 1>
<bad stuff 2>
<good stuff 1>
<good stuff 2>
<good stuff 3>
--------------------------

What I call <bad stuff> is HTML added by the editor e.g. the
<head>...</head> part.

Has somebody got an idea how to supress the output of these <bad stuff>
fragments? It would be nice to tell velocity "parse this file (B.vm in
this case), but ignore anything outside the velocity directives".

Or does somebody know of a kind of preprocessor to extract the velocity
directives from a file?

Graceful for any hints.

Regards Dirk


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise