On Tue, 13 Jun 2000, Stephen Pair wrote:
> Has anyone played around with converting plain HTML pages into the Swiki
> syntax?
Yes, at least, in thought :). Well, there was some dorking around at one
point...
My prefered idea was to use the HtmlParser to parse the HTML, and then
either add a "asSwikiFormat" like method to each node, or figure out a way
that HtmlFormatter could be subclassed to handle it (this was a *while*
ago!).
The tricky bit, I think, will be preserving markup for which there is no
direct Swiki equivalent. Of course, you can just pass on those tags, but
the HTML should be "roundtrippable" to use DreamWeaverSpeak ;)
Indeed, I've thought it would be interesting to parse to a neutral format,
accepting and providing different edit syntaxes. The main problem, of
course, is losing stuff in the downtranslation.
But for one time convertions, or learning, this isn't a big deal.
The more general case requires dealing with carefully selected compatible
subsets of some of the formats, or enduring the painof mixed syntax
(aieee!) ;)
Cheers,
Bijan.