Re: [Jamwiki-devel] Custom Tag discussion
Brought to you by:
wrh2
From: <jam...@li...> - 2012-01-20 06:27:04
|
Wow! How quick! Your correct the implementation you explained would allow me to do what I am thinking now to do. However there are a few enhancements, which I think would make this feature even more flexible and powerful: I don't know JFlex enough to say if this would be too complex, but if you can make it aware of Custom Tags on all iterations and call different methods for each iteration, then Custom Tag class could include in the output the same (or different) Custom Tag to be handled by later iterations. If the whole conversion get completed in the early iterations, then the class won't insert its Custom Tag and later iterations won't even call the methods. In order to do that all methods should receive the tag name as a parameter in addition to the attributes and inner-text. In addition the special methods of all Custom Tag classes should be called before start parsing the topic and different ones after finishing. All this would allow implementation using Custom Tag functionality like TOC or references. Also would be nice to allow Custom Tag class methods to be able to access the environment like Name of the Page, User, created the topic, when it was created, same for last update, may be whole history, etc. Because of what I suggested the Custom Tag class would need to implement many methods (at least 4) the based class would be helpful with default implementations. Before First and After Last methods wouldn't have attributes or text to convert and default implementation would be empty. The parse to HTML method would copy the text into its output, but the rest of the methods would take attributes, text and tag name and return the text, surrounded in the tag with attributes. In the mean time I am working on a couple Custom Tag classes of my own, which I think would be helpful. CAB |