How to enter code snippet in HTML or Drupal?

This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.


5 points

Hi,

 

 I am creating a website and I want to enter code snippet into HTML or Drupal? Do we have any module in Drupal?

 thanks,



15 points

http://drupal.org/project/geshifilter is the module to go for.

It highlights as follows:

<blockcode> 
<script type="text/javascript">
    FB
.init("[MY_API_KEY]", "/xd_receiver.htm",
           
{ "ifUserConnected" : fb_login_handler } );
</script>
</blockcode> 

 Basically, it is <code> tags that work.

programmer's picture
Created by sudeepg

Post Comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.