Version: 3.00.0 - last Update: Monday, September 21, 2009, 19:57:00
This thread is all about how to get VFP’s syntax coloured code to a HTML-formatted Blog like this is.
Introduction
We all know that since VFP 7 (am I right?) we are able to copy & paste our code to the Windows clipboard without loosing the syntax colouring attributes. FoxPro does it by adding an additional clipboard format to the Windows clipboard called “Rich Text Format” while stuffing the source code to it.
However, RTF formatted text is not the thing we need in our Blogs, because we need HTML formatted content there. Thus, we are looking for some lightweight implementation, which enables us to translate RTF based content to the appropriate HTML based one.
There are many tools out there to accommodate this – generally. However, none of them is able to deal with VFP’s RTF output out of the box correctly because of the following:
- VFP’s RTF output is poor!
- VFP’s RTF output is buggy!
- VFP's internal RTF writer has some bugs!
- It's not easy to get VFP's RTF encoded clipboard data (using native FoxPro code)!
Other ways are pretty hard to go:
- VFP's Class Browser's conversion capabilities are very limited
- Word is adding an incredible overhead to the HTML outcome
- Other commercial tools are expensive and are failing sometimes with VFP's RTF "slang"!
Well, IMOH, VFP’s developer crew tested their RTF output against WinWord only! In addition, WinWord is very forgivingly – at least when it comes to interpret RTF formatted text! The (final 9.0) VFP state we are in toady is that we are able to copy & paste everything from our VFP source code editor to any Microsoft text-processor, but we might fail when our pasting target is another WEB-based HTML application (even Microsoft’s own “Windows Live Writer” gets problems with VFP generated RTF sources!). Therefore, we need a tool that allows us to copy & paste our VFP’s syntax coloured RTF sources out to our Blogs or any other HTML based platform!
In other words: what we need is a home grown native VFP solution to solve this dilemma!
Table of Content
Keep on rolling
as usual!
Hi
ReplyDeleteI quote :
"Next, we have to translate those RTF encoded information into HTML tags and replace all RTF tags with the appropriate HTML ones..."
I was (and still am) considering about such a transportation, but the work amount needed seems, er, how should I say, unbalanced, if the next sentence does not let any possibility to go further than ...
"because there are not that much HTML tags needed. "
IMHO, your steps are clear and neat, but the goal appears to be "copy&paste" RFT. This looks a bit restrictive, no?
How about using "rules" in a chain of responsibility for translations ?
Christian - Bordeaux - France
Hi Christian,
ReplyDeletethe goal is:
Copy&Paste >>TO>> HTML as the final destination format; either into the Windows clipboard, or into a file (like VFP does it within the class browser) - There will be different sources to choose from: RTF-formatted clipboard content definitely is one of them :-)
I'm just rewriting part 6 of this thread - so be prepared: End of next week (until 11th of May) I will come up with a first stable beta version which will show all basic concepts more clearly :-)