Format Eclipse code snippets for blog publishing? - html

Visual Studio has a plugin that allows one to copy code from any editor (C#, HTML, XML) and then paste it with HTML formatting that preserves the syntax highlighting, etc.
This is very handy for publishing code samples/examples to a wep page/blog. I have seen one old (2006?) plugin for java to html conversion, but are there any broader solutions similar to the Visual studio plugin.
Really what I am looking for is a way to select and copy a syntax-colored block of text in Eclipse and paste it as formatted html+css.
Does such a thing exist?

Eclipse based solutions
Use the Java2Html plugin (this is maybe the plugin you were referring to):
This tool converts Java source code to HTML, XHTML and LaTeX with syntax highlighting.
There is also the CodeSnippet plugin:
CodeSnippet is a set of Eclipse plug-ins to convert Ant, Java, Properties, CSS, DTD, HTML, and XML source code (complete files or snippets) to HTML with syntax highlighting
Non Eclipse based
Use the online Source Code Formatter for Blogger, Blogspot, Blog & Blogging, Format Formatting Tool:
Source Code Beautifier And Formatter For Blogger and Websites, Format Source Code , Format Source code for blog or blogging & website, Online line source code formatter tool, blogger code format tool, Format source code for blogspot,Insert formatted source code

Although I don't know of such plug-ins, but generally pasting the syntax-highlighted text into Word or OpenOffice maintains its formatting, so using their HTML export (possibly the one of OpenOffice is useful here, as it provides simpler result, AFAIK).

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.
Steps to install the plugin:
Download the Copy as HTML eclipse plugin Copy it to the 'dropins' folder of your eclipse installation If 'dropins' folder is not present then copy it to the 'plugins' folder of your eclipse installation Restart eclipse IDE That's it

Related

python 3 - .swf to html

Is there a way to decompile flash files into html in python 3?
I'm using urllib to gather html data from a website and would like to include flash content .. in html format, as part of the rest of the html content, preferably without downloading the file.
The few packages available are old and not made for python 3 or are not web based.
There are many free online decompiler tools for this so I thought it would have been easier to find code for this.
Thanks in advance!
UPDATE
As a workaround solution I have found this:
http://www.nowrap.de/flare.html
Which is a command line swf to html converter. I'm considering calling it as a subprocess unless someone has a better idea?

Different code style settings in PhpStorm for php files based on file extension?

I'm using PhpStorm (and love it!), but the coding standard for my current project uses 4 space indents for .php files and 2 space indents for template files (.phtml). The template files are traditional php and HTML. Our code implements a standard Zend Framwork MVC setup.
Is there a way to configure PhpStorm to use one set of code style settings for *.php files and a different set of code style settings for *.phtml files?
Setting::File Type didn't work
I've tried associating .phtml files with the HTML file type, but that causes me to lose ALL php language assistance (no PHP syntax highlighting, no code assist, etc.).
Settings::Template Data Languages didn't work
I also looked for a solution using the the Template Data Languages setting. I setup my .phtml files to the File Type HTML, but PHP isn't an available setting, so it appears there is no way to add php language support for HTML files.
AFAIK it is not possible.
If you want to have PHP support, file extension has to be associated with PHP file type. That's the only way to have PHP support as PHP is not injectable language in current PhpStorm version/implementation.
You may utilize TextMate bundles support plugin and install PHP supported highlighting there. This will allow to assign .phtml extension to another file type. The drawback is that you can only have one language highlighting .. so HTML will not be highlighted + no code completion for actual PHP (that's as far as my simple experiments went with other not-yet-supported languages).

Convert RTF File into HTML in Objective C

How can I convert an RTF file into an HTMLformat ?? I have a text editor which saves the file in rtf format but I need to put the contents on my server. For that I need to convert the rtf file into that of an html.. I am unable to find any help with regards to Objective C . Thanks.
I don't know of any library in objective-c that does rtf to html conversion.
However if you are able to perform the conversion server side then that opens up a lot more possibilities, such as php and c# libraries, as well as gnu utilities.
For example (and you can google for many more):
php: Pa software's RTF to HTML converter (paid product), Martin Mevald's rtf2htm (old GPL'ed software), Marcus Fischer's RTF Parse class (GPL'ed code), Zend's LiveDocX or even alternatives to livedocx on SO alternative-for-phplivedocx .. etc
C#: On SO convert-rtf-to-html, simple-convert-rtf-to-html, or from MS Converting-between-RTF-and-HTML
GNU: GNU's UnRTF utility.
If you really want Objective-c then the source code of the php and GNU solutions could be translated - however that will not be a trivial task. As such I still think your best bet would be to do it server side.

JSON Javascript highlighting in Visual Studio 2010

Does anybody know how to get VS 2010 to use the same highlighting for a file called .JSON as it uses for a JavaScript file? Just working on a client site and they've named all their JSON template files as .JSON, with the result that I just get a plain old text editor when I open it in Visual Studio. Any suggestions? I'm sure there must be an option somewhere that would do it but I can't find it so far...
Tools -> Options -> Text Editor -> File Extension
End your extension 'json' and select 'Script Editor' and click 'add'.
Re-open any json documents for it to take affect.
Another option is to use Text Highlighter (extention for Visual Studio 2010), which offers syntax highlighting for the following text formats:
.json (also offer syntax validation)
.bat
.cmd
.ini
.txt
.log
Great news!
In CTP2 of Visual Studio 2013 Update 2 that was added a New JSON project item and editor

How to build HTML Documentation with Sandcastle

How to build CHM / HTML Documentation with Sandcastle? Can build HTML file from XML or have to used .cs and dll files?
How to build CHM / HTML Documentation with Sandcastle?
Use the Sandcastle Help File Builder.
Can build HTML file from XML or have to used .cs and dll files?
I think it uses the *.dll and the *.xml (both together) as input. One of the 'tips' in the SHFB documentation says,
"When selecting either an assembly or an XML comments file, the help file builder will automatically add the partner file for you (i.e. the XML comments file for the like-named assembly or the assembly for the like-named comments file). Multiple files can also be selected and added in one go or dragged from Windows Explorer and dropped on the Documentation Sources node."
Sandcastle uses dll to generate documentation. It also needs the xml from code comments to be build by visual studio. To do that, basically select output XML from your project build properties and then open the csproj (your VS project) in SandCastle Help file builder.