b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Demo
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Releases
  • Skins
  • Plugins
  • Locales
 
  • « Smilies plugin
  • Most Comments »

Code Highlight Plugin

Categories: Renderer Plugins, 2.x & above, 3.x (incomplete list), 4.x (incomplete list), 5.x, Downloadable Plugin, No longer needed, 6.x, 7.x
This plugin or hack is no longer needed as the functionality it provides has been integrated directly into the b2evolution core or into another (bundled) plugin.

This Renderer Plugin allows clean formatting of computer code in your posts.

We recommend using the more modern Prism plugin instead of this one.

Code Highlight Plugin
Download Now!
code_highlight_plugin-7.0.2.zip (20 KB)
AuthorAstonish Me
Last tested in version

This plugin renders character entities on the fly, so you can cut’n-paste normal code directly into your posts and it will always look like normal code, even when editing the post (i.e., no preprocessing of the code is required). Include line numbers (customizable starting number). The best part about the line numbers - visitors can cut’n-paste the code from your post, leaving the line numbers behind! Accepts BBcode tags and doesn’t render smilies. Coloration of PHP code, plus PHP manual links for PHP functions. Easy to install and easy to use. No hacks. Degrades nicely, if the plugin is off. Styling completely customizable via an included CSS file.

Plugin Settings

Code Highlight Plugin
  • XHTML strict: If enabled this will remove the ‘ target="_blank" ‘ from the PHP documentation links.
  • Display code toolbar: display code toolbar in expert mode and on comment form (individual users can override this).

Installation

In b2evolution v5 and above, it is recommended to use this plugin with a low priority (for example: 10) so that it is called before the other plugins.

One important thing that will happen is that when a post is saved (plugin event <code class="codespan">FilterItemContents</code>) will be fired, the plugin will transform shortcodes like [codeblock lang="php" line="5"] into markup like <!-- codeblock lang=php line=5 --><pre class="codeblock"><code>. This will allow for other plugins to be able to detect <code> tags and not render/alter text within computer code.

Usage

The easiest way to use this plugin is to use its toolbar:

Code Highlight Plugin

Attachments:

  • code_highlight_plugin-7.0.2.zip (20 KB)
Tags: 6.10.7

No feedback yet


Form is loading...

Plugin Repository

Plugins are little PHP scripts that allow you to add features that are not (yet) built into the b2evolution core.

How to...

  • Introduction to Plugins
  • How to install a plugin (after downloading it)
  • How to make a new plugin
 Upload a plugin!
Submit your own plugin

User log in

Lost your password?
Register »

Search by keyword

Filtering options

Retain only results that match:

XML Feeds

  • RSS 2.0: Posts, Comments
  • Atom: Posts, Comments
What is RSS?

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque