News:

Download Pelles C here: http://www.pellesc.se

Main Menu

Export C source as HTML or PDF file

Started by Pelle, March 16, 2005, 07:34:45 PM

Previous topic - Next topic

John Z

Hi Robert,

Quote from: Robert on January 23, 2026, 06:03:43 PMMy interest in your resurrection of the Pelles C Export addin is in the "Export to HTML" facility. I think it can handle Unicode identifiers and quotation mark embedded Unicode strings.

Yes - Export to HTML can easily handle UTF-8, I just did a quick update, but it should not take too much to fix it.

Quote from: Robert on January 23, 2026, 06:03:43 PMIf you are interested in developing a Unicode capable "Export to HTML" facility, you might find some help studying the BCX translated C codes of the example on the webpage

No need - I have already previously written as part of another Add-In program (LineCounter+  https://forum.pellesc.de/index.php?topic=10092.0 ) a module that does output a file in UTF-8 HTML.  Since Pelle C now defaults to UTF-8 rather than a codepage it should be even easier.

So - I'll take a look at fixing that part of the Export Add-In.  Attached is an HTML output example from the LineCounter Add-in.

John Z

Like you said previously, optimistically,  "Nothing is impossible."  :)

John Z

Making progress  :)

Some help used from 'vibe' coding too.

Here is the first output trial utf8 source to utf8 html.
More improvements to be done before posting new project files.

So this is just preliminary look.

John Z

TimoVJL

A good thing, that Add-In is still updated  :)
May the source be with you

John Z

Happy to do it.

Here is another output with actual UTF-8 characters :) I realized the first didn't have any 'special' characters.

The version is almost complete.  It also has an optional Dark output mode, and an optional Line Number output mode.  Just removing any nonsense I might have put in.

John Z

John Z

Attached is what I'm calling version 1.3.

It adds the ability to export an UTF encoded source file into an UTF encoded html file.
It supports color coding. If unwanted, change the colors in the source to black.
It supports output with line numbers added, if wanted.
It supports Dark background output, if wanted. (don't use black characters then  ;) )
It will partially work for UTF16le but I didn't try any characters unique to UTF16le (maybe later) as UTF-8 was the focus.

All sources included in the project zip as usual.
A Dark Mode with Line Numbers example is attached too.
Check the readme file for more information.

Done...

John Z


Robert

Quote from: John Z on January 31, 2026, 05:21:03 PMAttached is what I'm calling version 1.3.

It adds the ability to export an UTF encoded source file into an UTF encoded html file.
It supports color coding. If unwanted, change the colors in the source to black.
It supports output with line numbers added, if wanted.
It supports Dark background output, if wanted. (don't use black characters then  ;) )
It will partially work for UTF16le but I didn't try any characters unique to UTF16le (maybe later) as UTF-8 was the focus.

All sources included in the project zip as usual.
A Dark Mode with Line Numbers example is attached too.
Check the readme file for more information.

Done...

John Z

Thank you John Z. An Excellent job done !  ;D  8)

John Z

Attached is what I'm calling version 1.4

10/05/2026
Version 1.4 Removed options control off of the filename.
            Added an HTML output options dialog activated from the Pelles Menu for Tools, Options, Add-ins
            then select 'Export64 C Source as HTML, PDF, RTF File', then click Options button.

            When none of the first three options are checked the default output is the same as before -
            That means there is no need to use the Options if just wanting the original style output which was
            and is -  White background with colored text. 

            The other option choices are shown. Two new options have been included in this version.
           
            Click OK to save the choice.  Option choice will be retained through a Pelles C
            shutdown/restart
           
John Z

Updated project sources are attached - build it or just use the included export64.dll             

Robert

Thanks, John Z.

Windows 11 26H2
Pelles C 14.50.0
Dark Background and Color Text