Daniel Miller wrote: > Just one critique, would you consider using named constants or even > strings (case insensitive please) instead of the rather cryptic values > True, False, and None. These values imply little or no meaning by > themselves and it would be much easier to read and remember with > values like REMOVE_ALL, NO_CHANGE, REMOVE_TRAILING (trailing includes > extra empty blank lines. I'm not set on these names, so if you have > better ideas please feel free to change them.
Thought about this a little bit more over the weekend. We should offer increasing degrees of whitespace removal: - Nothing - strip trailing blanks - strip starting blanks on line (all indentation) - remove duplicate blanks and duplicate newlines - strip all whitespace between tags and between tags and text You're right, using names or strings for these operations would be better than only True and False. I also thought about combining these settings into a single "style" parameter that can be passed to the serializer and to the serializing functions, so that the serialization interface is not cluttered with too many parameters. The style parameter could comprise the whitespace handling, the indentation, and also other parameters such as the "transpose" parameter for HTML serialization (transposing tags to lowercase or uppercase). It could be implemented as a class SerializerStyle, and we could allow passing an instance of SerializerStyle or a string for using some predefined serializer styles to make it really handy (similarly as the "output" parameter is already implemented). -- Christoph ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ kid-template-discuss mailing list kid-template-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kid-template-discuss