SyntaxHighlighter as you know is a fully functional self-contained code syntax highlighter developed in JavaScript. Which helps you prettify your Code format and display it in an organized numbered list style. Most Blogspot users often share HTML, CSS or JavaScript codes with their audience using Blockquotes but with this new shortcode you can better display scripts on your sites in a presentable way. This plugin neatly displays web technologies such as HTML, CSS, JavaScript, Php, Python, Sql, xml etc. The codes are displayed line by line number wise. It also provides the user with options to
Print the code, copy it to
clip board or to see the code
Source. With SyntaxHighlighter Shortcode you can add codes not only inside your posts or sidebar widgets but you can also
insert it inside Blogger comments!
HTML
<div style="text-align: center;">
<ul class="button">
<li><a class="demo" href="YOUR-LINK-HERE" target="_blank">DEMO</a></li>
<li><a class="download" href=" YOUR-LINK-HERE" target="_blank">DOWNLOAD</a></li>
</ul>
</div>
<div class="clear"></div>
JavaScript
var example = true;
function foo(arg) {
console.log( "do", arg);
arg = example ? true : false;
return arg;
}
CSS
@import "somestyle.css"
body {
background: white;
}
.wrapper {
background: #F88;
color: #454545;
}
.box::after {
content: "...";
}
PHP
<?php
if (!defined('MEDIAWIKI'))
exit(1);
$wgExtensionFunctions[] = "wfSyntaxHighlighterExtension";
$wgExtensionCredits['other'][] = array(
'name' => 'SyntaxHighlighter',
'author' => array('Alex Gorbatchev'),
'version' => '1.0',
'url' => 'http://alexgorbatchev.com/projects/syntaxhighlighter',
'description' => 'Provides tight integration with SyntaxHighlighter.'
);
?>
DELPHI
procedure TMainForm.InvalidateChars(pos : integer);
var
rect : TRect;
point : TPoint;
begin
with Edit do begin
Perform(EM_POSFROMCHAR, LongInt(@point), pos);
rect.Top := point.y; rect.Left := point.x;
pos := Perform(EM_LINEFROMCHAR, pos, 0) + 1;
if pos >= Lines.Count then
rect.Bottom := Height
else begin
pos := Perform(EM_LINEINDEX, pos, 0);
Perform(EM_POSFROMCHAR, LongInt(@point), pos);
rect.Bottom := point.y;
end;
rect.Right := Width;
InvalidateRect(Handle, @rect, true);
end;
end;
Bash/shell
#!/bin/bash
echo "Starting the script, yo"
#this is a comment
DIR=/var/log
cd $DIR
my_function () {
rm -rf "$1"
return 0
}
for planet in Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune Pluto
do
echo $planet # Each planet on a separate line.
done
ppppppppppppppppp
Read More