How do I display syntax hightlighted FORTRAN/C++ source code?

J

Jason.S.Leigh

I have a project with many FORTRAN and C++ source files, and would like to
display the source code on my web page and if possible have the code syntax
highlighted.
 
T

Trevor L.

Jason.S.Leigh said:
I have a project with many FORTRAN and C++ source files, and would
like to display the source code on my web page and if possible have
the code syntax highlighted.
http://www.scit.wlv.ac.uk/encyc/code.html
suggests use of the <code> tag

If you don't like the default font or background, you can always add a style for <code> in the <head> section
e.g.
<style type="text.css">
code {font: arial, helvetica, sans-serif; background-color: aqua;}
</style>
 
J

Jason.S.Leigh

Here is what I've done, I created a web page with a bulleted list of the
FORTRAN and C++ source files I have in a directory, and each bulleted item
has a hyperlink to an .htm file where I wrapped the source code with the
<PRE> tag targetted to an inline frame, so I can scroll through the code.

The problem is that I have many files and I don't want to have to create an
..htm file for every source file and just wrap a <PRE> tag around it. I've
tried hyperlinking directly to the source file, but it opens an "Open/Save"
dialog box, which is no good because ultimately the web pages will be
compiled into a .chm HTML Help File.

What I would like to do is to be able to link directly to the FORTRAN or C++
source file and have it displayed inside a scrollable frame, preferrably with
syntax highlighting, without having to create an .htm file for each source
file.

Jason Leigh
 
T

Thomas A. Rowe

Not possible to do as you want, you have to create the HTML page and format it for each file.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage
==============================================
Agents Real Estate Listing Network
http://www.NReal.com
==============================================
 
Top