SyHi

SyHi Install Statistics

0
100%
Today: 0 Yesterday: 0 All-time: 2,128 downloads
SyHi Icon

Try plugin: SyHi

We'll create fresh WordPress site with SyHi installed. You have 20 minutes to test the plugin after that site we'll be deleted.

Takes ~10 seconds to install.

About SyHi

Minimalistic Syntax Highlighter plug-in which also makes sure code can still be copied and pasted into your favourite compiler!

0


0


0


0


0

updated: 13 years ago
since: 15 years ago

Description

This plug-in is totally designed for developers.

You know, that sort of people who post code snippets in their blog regularly and hardly use the Visual Editor,
because they write the HTML themselves. But they don’t like WordPress messing with their quotes and dashes,
so this plug-in makes sure no one touches one of their lovingly crafted lines of code.

It’s also very minimalistic – less than 10k, not counting the GeSHi syntax highlighting library which is also included.

In addition, it’s also lazy. It will try to avoid doing as much work as possible.
That is good, because it will not eat resources like other plug-ins out there.

Usage

Whenever you want to post some syntax highlighted code, surround it with <code lang="language"></code>. That’s it.

Example:

<code lang="php">
class HelloWorld()
{
    public function __construct()
    {
        echo "This is an unnecessarily long version of Hello World";
    }
}
</code>

The ‘lang’ attribute can be entirely omitted. You will get whitespace, quotes and dashes preservation… but no highlighting.

Uninstall

Just deactivate the plug-in, and remove its folder from the wp-content/plugins directory.

Thanks

Big thanks to the creators of the GeSHi library. Without it, the output of this plug-in would be very boring.
Here’s its homepage: http://qbnz.com/highlighter/

The following plug-ins were invaluable sources of inspiration and how-to-do-it-right:

  • Preserve Code Formatting, by Scott Reilly (http://coffee2code.com)
  • Code Snippet, by Roman Roan. Now maintained by Wyatt Neal (http://blog.hackerforhire.org/code-snippet/)

You could say this plug-in is the sum of the essence of both plug-ins.