velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Hoffmann <dh.replies...@web.de>
Subject Macro Defs with HTML-Editor
Date Sat, 24 May 2003 09:28:00 GMT
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


Mime
View raw message