Facebook Youtube linkedin Twitter feedburner Skype Me

Syntax Highlighter එක අපේ බ්ලොගයටත් දා ගමු..(මැක්සා වැඩක් ) 10





සෑම් | 9/24/2010 | , , ,





කොහොමද කට්ටියට :D ..මෙන්න මම අද ඔයාලට අරගෙන අවේ තවත් පට්ට බ්ලොග් ගැජට් එකක්...මතකද ඔයාලට මම කලින් දුන්නා බ්ලොගයේ පොස්ට් අතරට දාන Html code වලට දෙමු පොඩි ගතියක් කියලා ලිපියක්...එ වගේ ගැජට් එකක් තමයි මේ මම ඔයාලට අද අරගෙන ආවේ.මේ ගැජට් එකටත්...ඔයාලා කැමති නම් Html Code හෝ වෙනත් ඔනම දේයක් දලා Highlight කරලා පෙන්වන්න පුලුවන්...ඉතින් ඔයාලාත් ආසනම් මේ ගැජට් එක බ්ලොගයට දා ගන්න..මම පහල කියලා තියෙන විදියට වැඩ ටික කරන්න..

පලමුව ඔයාලා Dashboard >> Desing >> Edit HTML යන්න..මතක ඇතුව Expand Widget Templates තැනට හරිය දෙන්න..දැන් ඔයලා යතුරු පුවරුවේ Ctrl+F යතුරු එක වර ඔබන්න..දැන් ඔයාලට ලැබේයි සේර්ච් බාර් එකක්.


එතන ]]></b:skin> කියලා ටයිප් කරන්න..දැන් ඔයලාගේ HTML box එකේ මේ code එක Highlight වෙලා තියෙනවා පෙනෙයි..දැන් ඔයලා ]]></b:skin> කොඩ් එකට උඩින් මම පහල දිලා තියෙන කොඩ් එක Copy,past කරන්න..





ඉට පස්සේ ඔයාලා කලින් පරිදි </head> කොඩ් එක හොයා ගන්න.. </head> කොඩ් එකට පහලින් මම පහල දිලා තියෙන කොඩ් එක Copy,past කරන්න..


<!-- Add-in CSS for syntax highlighting -->
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shCore.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCpp.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCSharp.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCss.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushDelphi.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJava.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJScript.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPhp.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPython.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushRuby.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushSql.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushVb.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushXml.js' type='text/javascript'></script>



ඉට පස්සේ ඔයාලා </body>කොඩ් එක හොයා ගන්න. </body>කොඩ් එකට පහලින් මම පහල දිලා තියෙන කොඩ් එක Copy,past කරන්න.


<!-- Add-in Script for syntax highlighting -->
<script language='javascript'>
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
</script>




දැන් Template එක Save කරන්න...Save Template 

දැන් ඔයාලා පොස්ට් එකක් ලියනකොට මොකක් හරි කොඩ් එකක් Highlight කරලා පෙන්වන්න ඔනේ නම් පහල දිලා තියෙන කොඩ් එක පොස්ට් එකට කොපි,පෙස්ට් කරලා කොඩ් එකේ රතු පාටින් ඇති තැනට ඔයාලා දාන්න බාලපොරොත්තුවන කොඩ් එක දාන්න.


<pre name="code" class="cpp">

Your generated code should added here

</pre>


වැදගත්

අපි Highlight කරන්න ඔනේ කොඩ් එක Your generated code should added here තැනට දානකොට එම කොඩ් වල උඩින් සහ යටින් තියෙන කොඩ් 2කට නොගැවන සේ ඔයලා දාන්න බාලාපොරොත්තුවන කොඩ් එක දාන්න..එම කාර්ය නිවරදිව උනේ නැත්නම් අපි දාන්න බාලාපොරොත්තුවන වන කොඩ් එක Highlight වි පෙන්වන්නේ නැ.

කොහොමද වැඩේ...
ගැටලු තියෙන්වනම් කියන්න මම ඔයාලට උදව් කරන්නම්

ඔබට ජය

Fb comments:



10 Comment + :

සෑම් said...

@Anonymous

ස්තුති සහෝ කොමන්ට් එකට

Kasun said...

නියමයි මචෝ

Rbk said...

නියමයි..ගොඩක් ස්තුතියි

Killer said...

පට්ට..

කොල්ලා said...

එලම තමා...

සෑම් said...

@Kasun
ස්තුති මචෝ කොමන්ට් එකට

සෑම් said...

@Rbk

ස්තුති මචෝ කොමන්ට් එකට

සෑම් said...

@Killer

ස්තුති සහෝ කොමන්ට් එකට

සෑම් said...

@කොල්ලා

එල සහෝ

Shani (ශානි) said...

niyamai.. thanx....

මේම ලිපිය ගැන ඔයාලට හිතෙන කැමති දේයක් කියන්න.
ඔයලාගේ අදහස් මට හුගක් වටිනවා