Last Updated: February 25, 2016
· mxcl
Img 0719

Exporting Syntax Highlighted Objective-C as HTML

In pursuit of a good HTML outputted of syntax highlighted obj-c I found: there is no good open source solution.

Scouring the net I discovered however that you can:

  1. Copy the code straight from Xcode
  2. Paste into TextEdit (yes TextEdit, that editor you never use. Well here’s a use!)
  3. Save…
  4. Select output format of HTML

This works very well: http://methylblue.com/junk/SuProgress.html

Unfortunately the background color is not saved, but that is easy to fix.

NOTE ensure the code you copy from Xcode has no errors, this will ensure it is all syntax highlighted. Otherwise some parts may be the default (white/black) text color.

The HTML that is generated also is split into markup and CSS so you can tweak it if desired.

Say Thanks

1 Response
Add your response

Def26aa573b4fba893bd960bb485a1fa normal

Awesome thank you Max!

Are there any easy workflows to quickly grab the HTML code to reduce the number of steps?

over 1 year ago ·