Syntaxhighlighter Drupal module

in

This module integrates the SyntaxHighlighter Javascript Library into Drupal for source code list syntax highlighting within any Drupal contents. All source code listing on this site is done with this module. See my article about this module here.

No votes yet

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

feature suggestion/request

Friend's picture

First off, great module!  Really a great module for any site that needs to post code.<br>

I wanted to suggest either an addon to this module or a new cck field module that creates a textarea in a content type that is specifically for code and does not require the {syntaxhighlighter} tags.  The tags are great for inline text but are rather inconvenient for users when you have a content type that is specifically for posting code.

You can use the pre tag anywhere

Alpha Epsilon Delta's picture

So in any place where you want highlighted code to appear, you can use the Syntaxhighlghter's <pre> tag format. So you can just do this:

blah blah blah some thing something...

<pre class="brush:xyz;gutter:false">

code here

</pre>

more blah blah blah

<pre class="blush:php">

some other code

</pre>

This way you can have code anywhere, not limited to where you put the CCK field.

I've thought about this and this is the way I intent this module to work.

If you have better idea, please let me know.

Post new comment

 
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Syntax highlight code surrounded by the {syntaxhighlighter OPTIONS}...{/syntaxhighlighter} tags.
  • Allowed HTML tags: <a> <p> <span> <div> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <embed> <object> <param> <strike> <caption>
  • Insert Google Map macro.
  • Use [toc list: ol; title: Table of Contents; minlevel: 2; maxlevel: 3; attachments: yes;] to insert a mediawiki style collapsible table of contents. All the arguments are optional.

More information about formatting options