You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Dirk Hoffmann <dh...@web.de> on 2003/05/24 11:28:00 UTC

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


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org