Click here to Skip to main content
15,886,199 members
Articles / All Topics

Syntax Highlighter

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
29 Apr 2015CPOL 7.3K   3   3
Syntax highlighter

The Issue

When I wanted to start this blog, I had in mind that this blog will be a technical one, to share what challenges I face and overcome. So obviously I needed a tool/plugin/script whatever to highlight the code I post. So I’ve started a search to find what the best tools are out there and I found the following;

Each one of them has its pros and cons, but what really mattered to me is the support for all of the keywords, for multiple languages, as for example the wordpress plugin did not support the generics, so it ended lower casing any text between the <>.

Another thing I wanted something dynamic as for coloring, font, etc. as if I wanted to transform my code format from Visual Studio to the HTML page.

The One

After testing more than five syntax highlighter plugins, I found a Visual Studio extension that enables you to copy code as HTML as if it is displayed in the Visual Studio.

Example

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
 
            // Keep the console window open in debug mode.
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
    }
}

Happy copy and pasting code. ??

The post Syntax Highlighter appeared first on Ghaleb's Blog.

This article was originally posted at http://ghalebbadran.com/syntax-highlighter

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United Arab Emirates United Arab Emirates
www.ghalebbadran.com

Comments and Discussions

 
QuestionAfter posting a blog post with this VS plugin does the code copy without line numbers? Pin
rhyous30-Apr-15 11:26
rhyous30-Apr-15 11:26 
AnswerRe: After posting a blog post with this VS plugin does the code copy without line numbers? Pin
GhalebBadran30-Apr-15 18:17
GhalebBadran30-Apr-15 18:17 
QuestionThis was a blog... Pin
OriginalGriff30-Apr-15 0:07
mveOriginalGriff30-Apr-15 0:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.