Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

formatting cpp source into html?


  • Please log in to reply
5 replies to this topic
bobbysoon
  • Members
  • 81 posts
  • Last active: May 03 2014 09:50 PM
  • Joined: 15 Mar 2011

Any nifty tricks for doing this? I'd like to generate html for given cpp example codes in a .chm help reference from cpp files.



joedf
  • Administrators
  • 986 posts
  • AutoHotkey Foundation
  • Last active: Nov 02 2019 08:38 PM
  • Joined: 20 May 2012

i suggest you checkout SyntaxHighlighter,...it supports C++.
"SyntaxHighlighter is an open source Java Script client side code syntax highlighter."
Here is a list of the supported languages.
 
or checkout Natural Docs...
 
cheers!grin.png


Why ahkscript.org? - autohotkey.com is outdated

bobbysoon
  • Members
  • 81 posts
  • Last active: May 03 2014 09:50 PM
  • Joined: 15 Mar 2011

That JavaScript one looks perfect. Thanks so much :)



bobbysoon
  • Members
  • 81 posts
  • Last active: May 03 2014 09:50 PM
  • Joined: 15 Mar 2011

I copied a brush and added vars for engine specific functions and variable types, and gave them their own colors. I'm happy with the results.

Even better would be if the functions could link to their description pages, as <a href="function.htm">function</a> does, for a page in the same folder. You happen to know a way to do this?

 

Alright, going with a two-pass approach, Chrome automation, and RegExReplace.

Thanks again. Cool formatter there. Works in .chm also, but slippery with the searches.



joedf
  • Administrators
  • 986 posts
  • AutoHotkey Foundation
  • Last active: Nov 02 2019 08:38 PM
  • Joined: 20 May 2012

OH i get it you would want doxygen for that..

its a bit more complicated though :p

 

www.doxygen.org/


Why ahkscript.org? - autohotkey.com is outdated

bobbysoon
  • Members
  • 81 posts
  • Last active: May 03 2014 09:50 PM
  • Joined: 15 Mar 2011

Thanks JoeDF. But SyntaxHighlighter does quite well. I've batch-jobbed re-saves of what it's javascript generates from a browser, then RegExReplaced in the links. Just gotta work out some trouble with long file names now. Seems >32 chars is not ok.