5 Useful tools to convert your entire code into Colorized and browsable HTML

When you open your blog for sharing code, writing programming tutorial, publish a entry about codes, you should colorize, it called convert the entire code into colorized and make browsable with HTML. There are so many ways to do that, you can copy the code into web page design program and make up your code, but you don’t know what’re the easy ways to do that thing.

1- Use syntaxhighlighter:

This tool base on java script and stylesheet, the most popular Syntax Highlight tool in the internet, WordPress is now using this tool to highligh the code embebed.
Homepage: SyntaxHighlighter in Google Code
Download: syntaxhighlighter
Usage: manual

I like this tool because it will automatic convert the code after the web browser loaded. Because that, the code will not be formated and you can edit it later easily.

It support so many language: PHP, SQL Query, Java, Python, C# …..It’s cool, right?

2- Using PHP’s Built-in Source Highlighter:

PHP offer two functions for highlighting PHP code: highlight_file() and highlight_string(). Both functions return the same results, but each has its own specific input parameters. As their names suggest, the first function takes the filename of the PHP script whose code is to be highlighted, while the second takes the input as a string.

A Quick Example
Let’s take a look at an example of the highlight_string() function in action:

  1. <?php
  2. include_once ‘init.inc.php’;
  3. if (!emptyempty($_POST[‘text’])){
  4. echo ‘<div style=”border: solid 1px orange; padding: 20px; margin: 20px”>’;
  5. highlight_string($_POST[‘text’]);
  6. echo ‘</div>’;
  7. }
  8. ?>
  9. <form action=“<?php echo $_SERVER[‘PHP_SELF’]?>” method=“post”>
  10. <textarea name=“text” style=“width: 300px; height: 200px”><?php
  11. echo @$_POST[‘text’];
  12. ?></textarea>
  13. <br />
  14. <input type=“submit” />
  15. </form>

4- CodeColorizer: Free Tool to Colorize Code in HTML or RTF.

This application allows you to generate HTML or RTF so you can colorize:

  • C#, VB.NET, J#, Javascript, Cobol, Algol
  • HTML, XML, XSLT, .Config
  • T-SQL
  • CSS, and many more…

5-Csharpfriends.com Online Code Formatting:

Online site formatting with following code: C#, VB.NET, J# and T-SQL.
Its useful for who dont want to install any program into computer and dont need to add any code into webpage to do automaticlly, you just do it online, copy and go back to your working
Link to converter: CSharpfriend Online Code Fomartting


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: