Cpp->Html();

  So you've came here to see something about CppToHtml, that's nice of you. So here you are:

  CppToHtml, as it's name doesn't hint, can process any text file of any form, and convert it to HTML, using simple rules, defined in a txt file. The highlight color and other decorating stuff such as bold, italic, underlined etc. Actually, it could be named "CodeToHTMLorXML".
  It's nature assumes the source text to be kind of programming language, with keywords, comments, strings, etc. It doesn't assume parsing of nested syntax such as PHP files, and HTML with scripts generally, etc. For example, PHP code can't be parsed, as it is surrounded by html code (or worse :), and it wouldn't be nice to have html parsed like PHP code. (Or would it? I'll try and let you know.) (No, it wouldn't.) But if you really insist at higlighting HTML code via CppToHtml, you could, but the result is quite poor.

Recent changes
- Current version is 1.2.37
- I have created a ChangeLog
- Error reporting improved
- Can work as a CGI now - se apache httpd.conf fragment (and, of cource, formatted one)
- Output can be XML with DTD and CSS (and I am working on XSLT version)

What next?
  I'm going to do several things to improve CppToHtml:
1) To rename it to CodeToHtml or so :)
2) Done - It will work as a CGI to make it usefull on servers
3) The current .txt configuration file will be a .xml [some day]
4) "Nested syntax" will be parsed, like PHP or JavaScript code inside HTML, DTD inside XML etc. [when I have time]
5) The XML output should generate XSLT to transform it to HTML [when I learn XSLT better]
6) To write some documentation. Generally, only I know what exactly does it do. [when I have time]
X) (you) Suggest what you wish to be changed or added.

Some samples follows:
Note: some comments and few variables' names are in Czech language.

/*********************************************************
  C++ To HTML                      by Ondra Zizka         
  =============                    ondra@dynawest.cz      
  Colors the C++ code and outputs it as a HTML code       
*********************************************************/
#include "stdafx.h"
#include "CppToHtml.h"
#define APPNAME "CppToHtml"
#define APPVER  "0.9.6"

/*********************************************************************************
* UnEscape - \n -> enter                                                         *
*********************************************************************************/
void Unescape(char* str){
  static char a[] = "a"  "b"  "f"  "n"  "r"  "t"  "v"  "\\"  "0";
  static char b[] = "\a" "\b" "\f" "\n" "\r" "\t" "\v" "\\"  "\0";
  register char *z = str, *kam = str, *kde;
  register int c = *z;
  do *kam++ = (c=='\\' && (kde=strchr(a,*++z))) ? b[kde-a] : *z; while(c=*++z);
  *kam = '\0';
}
Do you like it? :) Take more:
  CppToHtml.cpp (13.9k) - the source file of this tool, C++ format (cut)
  CppToHtml.cpp.html (80.7k) - the result in HTML, using kw_cpp.txt
  CppToHtml.cpp.css.html (53.8k) - the same using CSS instead of font's attributes => smaller file
  CppToHtml.cpp.xml (27.3k) - the same using XML => even smaller file in 16 ms.
  QuickSort.cpp (2.6k) - the source file in C++
  QuickSort.cpp.html (25.4k) - the result in HTML, using kw_cpp.txt
  QuickSort.cppb.html (18.1k) - the same souce, using kw_cppbuilder.txt, what simulates weird style from buider.cz
  notace.pas (16.0k) - the source file in Pascal
  notace.pas.html (59.2k) - the result in HTML, using kw_pas.txt
  notace.pasold.html (62.5k) - the result in HTML, using kw_pasold.txt
  xindex.html (3.6k) - the source file in HTML (this page, cut a little bit)
  xindex.html.html (7.7k) - the result in HTML, using kw_html.txt
  httpd.conf (16.8k) - Apache configuration file (cut)
  httpd.conf.html (26.5k) - the result in HTML, using kw_apache.txt
   Note: This example uses created extern CSS file (apache.css).

Do you still like it? :) Write me: ondra@dynawest.cz

Thanks for your visit!