[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: Feature request: removal of "unwanted" tags

Hello Fritz Zaucker, in a previous mail you wrote:

> I am designing a small set of tags for the web-pages of our site. The
> idea is to give a list of these agreed on tags to the authors of our
> various pages. They are then "allowed" to only use these tags and no
> others. Especially the use of "standard HTML tags" would be
> "forbidden".
> It would be nice to have a mechanism the tell WML which tags are ok in
> the WML input files. WML should then remove all other tags (I guess in
> path 1) and may be send a message to STDERR about what it removed.
> I guess it would be easy enough to use an external filter, but may be
> this be easily included as a standard feature?

> P.S.: Please don't send me messages about "power to the user,
>       ...". The idea is to find an agreement with the people involved
>       and just to force ourselves to eliminate WYSIWYG markup. A
>       wml-lint, so to speak.
>       Of course, one could even implement a command-line switch so
>       that one can either remove unwanted tags or just warn about them.

Currently I think the most flexible way to integrate this cleanly without
doing quick hacks is to add a -P/--prolog=PATH flag to WML, similar to the
already existing -E/--epilog=PATH flag. While the PATH of -E is a filter which
is applied to all(!) outputfiles the PATH of -P could be a filter which is
applied to the input file. 

There is only one decision remaining: the problem of include files.  When -P
just filters the input file, we don't get the include files.  Alternatively we
could apply the filter _after_ pass 1 (IPP), so we also get the include files.
But this approach is a little bit unusual and not very intuitive to the user.

On the other hand, it is not useful to filter the include files, because you
really need some WML stuff to produce the final HTML output. So it is only
useful to filter the single input file itself.

BTW: The filtering script itself is not very complicated. 
     I'll write one for WML 1.6.0. What should it do. My
     current todo-entry is as following:

     o wml_aux/tagfilter/

       -f <configfile>  where to find the config file
       -w               just warn but don't remove anything

       The <configfile> then has lines of the form
       ``[SC] tagname''
       where S means single tag and C means container-tag.

Any more ideas?
                                       Ralf S. Engelschall
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com