Thomasz
Thomasz

Reputation: 233

Is there a way to export code to HTML in Eclipse?

I know NetBeans has this feature, but I can't find it in Eclipse. A quick search for plugins was not successful.

Upvotes: 11

Views: 8735

Answers (3)

GBa
GBa

Reputation: 18397

Java2Html - Eclipse Plugin:

Convert files:
Select items in the Package Explorer, Navigator or other views and right click to open the context menu. There is a Java2Html menu item that opens the conversion dialog.

Convert text from a text editor:
Right click on an editor and choose the Java2Html context menu item to convert the current selected text.

Adjust preferences:
Colors, tab size, etc. for conversion can be adjusted on the preference pages (Menu "Window" - "Preferences" - "Java" - "Java2Html")...

Upvotes: 11

shoosh
shoosh

Reputation: 78934

Hackish way:
On Windows at least, when you do Ctrl-A (Select all), Ctrl+C (Copy) what actually gets copied to the clipboard is formatted text (with all the colors and fonts). Then you can paste (Ctrl-V) it to something that can accept formatted text, say Microsoft Word or even Wordpad and save it to whatever format you wish.

Upvotes: 5

JavaMave
JavaMave

Reputation: 51

The Copy as HTML eclipse IDE plugin allows us to directly copy our code as HTML and paste it to our blogs or forums without any formatting.

Download Copy as HTML eclipse plugin Download icon

Steps to install the plugin:

  1. Download the Copy as HTML eclipse plugin
  2. Copy it to the 'dropins' folder of your eclipse installation
  3. If 'dropins' folder is not present then copy it to the 'plugins' folder of your eclipse installation
  4. Restart eclipse IDE
  5. That's it

Steps to Use

  1. Select the code or text to be copied
  2. Select 'Copy as HTML' option or press 'cntrl+shift+3'
  3. Paste it your superb blog

Copy as HTML

Taken from here:
http://java-sample-program.blogspot.hu/2012/12/copy-as-html-eclipse-plugin.html

Upvotes: 1

Related Questions