Nonstop Bits' Nonstop HiLighter module provides a Drupal filter to syntax hilight code snippets for over 250 programming languages.

Initial beta release for the Nonstop HiLighter filter module can be downloaded from our releases section at: http://www.nonstopbits.org/project/releases

Thanks,
Tony Bierman
http://www.nonstopbits.org

Comments

chrisada’s picture

Is there a demo of the result? I can't seem to get it working for xthml, phphtml (blank output), while latex is not highlighted at all.

inteja’s picture

Worked for me! Awesome stuff!

Brian.

--
Brian.

Steven’s picture

The following line:

		$language_fname = "$BEAUT_PATH/HFile/HFile_".$language.".php";

seems suspicious to me, as $language is passed by the user and no checks are performed on it.

biermana’s picture

Hi Steven,

You've mentioned a known bug. I've made the fix, closed the bug report, and released a new version of Nonstop HiLighter.

Please get the newest release from the project's page:
http://www.nonstopbits.org/node/151

Thanks,
Tony Bierman
http://www.nonstopbits.org

sepeck’s picture

anyway you could store that on the main Drupal.org site? Nice central modules location?

:)

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

biermana’s picture

What is the process for adding a module project to drupal.org's downloads? Is there a guideline for this somewhere?

Tony Bierman
http://www.nonstopbits.org

Steven’s picture

chrisada’s picture

I downloaded the latest release and tried again. It still doesn't work and here are some details.

I enabled the module, create a new input format, with nshighlight the only filter. A node is created with the following input:

[nscode lang="csharp"]

// Factory Method pattern -- Structural example

using System;
using System.Collections;

// "Product"
abstract class Product
{
}

[/nscode]

The result can be seen at http://ichris.ws/node/783 What I can tell from the result is:

  • The CSS file is loaded correctly
  • The input went through the filter, and the nscode tag was stripped out. But what is inside doesn't seem to be parsed.

Is there some internal path which I should set? (for perl, or beautifier, or ...) My drupal installation is at /home/username/public_html/ and I installed the module in /home/username/public_html/modules/nshighlighter

biermana’s picture

Chrisada,

I was able to duplicate the behavior you're experiencing. Go to administer>input formats and select 'configure' for the input format that Nonstop HiLighter is asociated with. On the subsequent page click the confiligure tab and ensure the filter is 'enabled'. When I have this set to 'disabled' I get similar output to you.

You may need to remove and re-add the Nonstop HiLighter filter to your input format to get an un-cached version of your node.

Nonstop HiLighter has been tested with the CVS version of Drupal.

Let me know if this helps.

Thanks,
Tony Bierman
http://www.nonstopbits.org

chrisada’s picture

I works now, and works great! Thank you for your help. I'm using Drupal 4.5.1, by the way, and it is ok.

The README.txt file did not mentioned the 'fileter enable' part, but I should have spotted it. Thanks for pointing that out. A question here though, isn't the setting redundant? Users would already have select the nshighlighter filter before that option to enable/disable appears. I just can't imagine the situation when you would need it to be off. (may be I'm missing something here)

Anyway, thanks again. You made my day :)

Steven’s picture

Any filter can be used in any input format, hence the checkboxes are not redundant.