Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ syntax highlighting html generator

I'm writing blog posts for my company blog and I would like code snippets to show up with syntax highlighting.

All I can do is write html/css.

Is there any app/webapp that will let me paste in a c++ code snippet and get a chunk of html with the highlighting?

like image 953
Randall Avatar asked Aug 29 '11 21:08

Randall


People also ask

How do you highlight code in HTML?

The <mark> tag in HTML is used to define the marked text. It is used to highlight the part of the text in a paragraph.

How do you highlight codes?

Highlight using the HTML5 <mark> tag If you are working on an HTML5 page, the <mark> tag can quickly highlight text. Below is an example of the how to use the mark tag and its result. If your browser supports the <mark> tag, "highlighted text" should have a yellow background.


2 Answers

Try this Online syntax highlighting Site, and especially the C++ section.

You paste in your code and it does the hard work.

like image 148
Miguel Avatar answered Sep 24 '22 11:09

Miguel


I use emacs M-Xhtmlize-bufferRET. Also enscript is very powerful to generate colorized HTML from many source code formats.

like image 40
Diego Sevilla Avatar answered Sep 21 '22 11:09

Diego Sevilla