Pelles C forum
Pelles C => Add-ins => Topic started by: Pelle on March 16, 2005, 07:34:45 PM
-
The attached Add-In can be used to export C source code as a HTML or PDF file - with syntax color highlighting. Maybe useful to someone...
Tested with 3.00 Beta, but will probably work with 2.90 too...
New Mar 18: Added export to PDF files...
New Mar 22: Added compression to PDF files... - thanks Timppa!
- Use Export.ppj for no compression.
- Use ExportZ.ppj for compression - in this case you also need ZLIB 1.2.2 (http://www.zlib.net) in the subdirectory zlib-1.2.2.
Pelle
-
Very nice work
-
Hello Pelles,
Very useful program :)
BTW, in the same taste, a C to XML would be nice :)
-
Very nice work
Thanks, Vortex!
Pelle
-
Hello,
Very useful program :)
BTW, in the same taste, a C to XML would be nice :)
Thanks!
I'm not sure about the best representation/format for XML. Do you have an example, or know where I can find it...?
Export to PDF files would be nice to, but I'm not sure how to do that either.
Pelle
-
Hi,
XML ?
Yes i have ideas :)
<PROJECT>
<FILENAME>MySample.c</FILENAME>
<BEFOREFOOS>#include + declares + ...</BEFOREFOOS>
<FOOS>
<NAME>specialfoo</NAME>
<BODY>void specialfoo(void)...</BODY>
...
</FOOS>
<FOOS>
<NAME>otherfoo</NAME>
<BODY>int *otherfoo(void)...</BODY>
...
</FOOS>
</PROJECT>
would be a good start ? :)
After that, one can imagine making easy documentation and/or snippet database combined with an XSD layer it can be terribly useful :)
Hello,
Very useful program :)
BTW, in the same taste, a C to XML would be nice :)
Thanks!
I'm not sure about the best representation/format for XML. Do you have an example, or know where I can find it...?
Export to PDF files would be nice to, but I'm not sure how to do that either.
Pelle
-
OK, but this requires a different parser that better understands various C elements, like functions. Maybe some day...
Pelle
-
Export to PDF files would be nice to, but I'm not sure how to do that either.
If you check out SciTE, it has an export to PDF function (in SciTE itself, not Scintilla), although I'm not sure if the export maintains highlighting. But it might be a start to get you going.
http://scintilla.sourceforge.net/
Good luck!
-
If you check out SciTE, it has an export to PDF function (in SciTE itself, not Scintilla), although I'm not sure if the export maintains highlighting. But it might be a start to get you going.
Thanks - I will look at it. I found a reference manual at Adobe. I got it working in 'hack-ish' way - need to make it more reusable...
Pelle
-
Hi Pelle:
I have modified your C to HTML converter addin so that the size of the exported HTML is significantly decreased. I enclosed the exported <body> .. </body> with <pre> ... </pre>, allowing <br> to be discarded, and replaced "class" with "id", and replaced "span" with "code" allowing " " to be replaced with a space.
I have only used the output with I.E. 6.0 so programmers using other browsers may have issues with the HTML export.
Merry Christmas to all !
Robert Wishlaw
-
Hello Robert,
Cool - thanks!
...and Merry Christmas...!
Pelle
-
Great thing, could be very usefull - thx
Merry christmas!
-
Hi Pelle:
I have modified your C to HTML converter addin so that the size of the exported HTML is significantly decreased. I enclosed the exported <body> .. </body> with <pre> ... </pre>, allowing <br> to be discarded, and replaced "class" with "id", and replaced "span" with "code" allowing " " to be replaced with a space.
I have only used the output with I.E. 6.0 so programmers using other browsers may have issues with the HTML export.
Merry Christmas to all !
Robert Wishlaw
Attached is a revised version of Pelle's C to HTML converter in which the "id" selector has been reverted to "class".
Although "id" seems to work, according to the CSS 2.0 standard, it is not meant to be used in more than one element instance and so multiple instances are tagged as non-compliant in strict type checking editors.
This non-compliance will probably cause problems in the future as the browsers become more compliant to the CSS 2.0 standard.
Robert Wishlaw
-
Is it ok to include exportToHTML2.zip on my web site ?
John
-
Hi John:
Yes, go ahead, I have no objections.
Robert Wishlaw
-
Hi John:
Yes, go ahead, I have no objections.
Robert Wishlaw
Thanks.
John
-
Hi Pelle!
When I try to compile this ADDIN using Pelles C 5.0 BETA I get the following error:
Building Export.obj.
C:\Arquivos de programas\PellesC\Include\addin.h(987): warning #2099: Missing type specifier.
C:\Arquivos de programas\PellesC\Include\addin.h(987): error #2001: Syntax error: expected ';' but found 'ADDIN_FIND_IN_FILES'.
C:\Arquivos de programas\PellesC\Include\addin.h(987): warning #2099: Missing type specifier.
*** Error code: 1 ***
Done.
I guess there is a little bug in addin.h?
Thanks
-
Updated to support form feed / page break too and RTF.
EDIT 2013-10-09: fix for CRLF (for Win7 WordPad?)
EDIT 2014-02-01: fix RTF font name.
-
Hi Timovjl:
Thank you for the update.
Robert Wishlaw