- HTML
- XML
- JavaScript
- SQL
- C#
- VB.NET
- ASPX (C#)
- ASPX (VB.NET)
- {C++}
- PHP
Note: Update the 1.0 release to 1.0.1 which has several significant bug fixes.
The build number for 1.0.1 is 62759.
how to use colorcode with my .net blog i just downloaded dll and no idea? please if you can tell me the way to use this software!!!
Hello gayancc,
The simplist case is taking some text and colorizing it. There is a code sample on the home page of the project, but here it is:
string colorizedSourceCode = new CodeColorizer().Colorize(yourSourceCode, Languages.CSharp);
If you want to do something else, like add support for a new language or change how the text is colorized, for instance, please let me know and I can provide a sample.
I hope this helps!
Cheers, Drew
hi drewmiller
thank you very much for the kind reply and all i want to do is i'm currently developing extension for my blog (dotnetblogengine). so i don't like javascript syntax highlighter colorize. OK i'll try this thanks again.
Hi,
I made some minor modifications and added new functionality to use an external css style sheet and css classes for highlighting instead of using foreground and background colors. It is now possible to generate html similar to <span class="ccComment"> ....</span> instead of <span style="color: red"> ... </span>
I am also planning to add multi language highlighting, to detect and properly higlight inline css or javascript blocks in html code, or php code blocks etc.
How I can join the project and commit (I mean push) my changes? Please contact me
Thanks
Serkan Özkan
I have a question, does this library already have support for nested languages? I didn't understand what LanguageParser.AppendCapturedStylesForNestedLanguage is used for. It would be nice to have some source code documentation.
I thought about adding some new members (like parent language, regex for language start and end tags) to ILanguage but I gave up since it would require massive modifications. I am planning to implement my own ILanguageParser and first split text into chunks of languages and colorize them seperately and then return the merged result.
For example the following php source code will be first split into chunks of languages and colorized seperately using their respective languages :
<html>
somehtmlcode... will be highlighted as html
<?php
php code... will be highlighted as php
?>
<script language="javascript">
somejavascript code... will be highlighted as javascript
<?php inline php code highlighted as php inside a javascript block ?>
</script>
Any ideas are welcome
I am trying to get this to work in Visual Studio 2010 as an addition to a project in VB. Every time I try to run my project VS seems to forget that I have added the DLL as a reference as well as ignores the "Import ColorCode" statement.
Can you provide precise instructions for adding this to a VB 2010 project?
Thank you
Hi,
I am new to .net. How can i use the colorcode.
I write something in my code
string filecontent = File.ReadAllText(nodefullpath); string colorizedSourceCode = new CodeColorizer().Colorize(filecontent, Languages.Html); htmleditor.Text = colorizedSourceCode;
where htmleditor is a multiline textbox. But i didn't get the colored code in this textbox. where i am doing wrong please help me...
Hi,
I try with following code
string filecontent = File.ReadAllText(nodefullpath); string colorizedSourceCode = new CodeColorizer().Colorize(filecontent, Languages.Html); htmleditor.Text = colorizedSourceCode;
but i am unable to get the colored syntax. can you please provide a sample for the same.
Regards
gsknbabu
Hello there!,
First of all thanks for this great control with so many possible options.
I tried to use it today without success. Unfortunately when I was doing :
Dim colorquery As String = New CodeColorizer().Colorize(query, Languages.Sql)
txtQuery.Text = colorquery
as the result I receive pure HTML in my text box instead of coloured text. Can you please explain what I am doing wrong?
Peter
guys,
do you plan on updating the package for razor support?
I would like to use a style steet so i can change a few styles like background color, also so that i dont have inliine styles in code.
Is this possible and how to do if is possible?
I have got it working in VB, usesing VS 2010, I an not sure why you are having problems, maybe try removing ref and re adding and rebuild project Dim coloredCode As ColorCode.CodeColorizer = New ColorCode.
Dim sourceCode As String = My.Resources.Resources.IHttpModule
Dim colorizedSourceCode As String = coloredCode.Colorize(sourceCode, ColorCode.Languages
.VbDotNet)