This project is not covered by Drupal’s security advisory policy.

This module functions pretty much like the image manager for popular WYSIWYG editors except that instead of working with images, this one works with codes (code browser). It stores code fragments that can be edited/created from the WYSIWYG editor. The code fragments are stored in the content using tags. These codes can also be reused on other nodes.

Codes fragments are syntax-highlighted using the Geshi filter module.

Installation

  1. Enable the Code Snippet module
  2. Enable the filter to use code snippets
  3. Configure TinyMCE to have the Code snippet button added

The <> button should appear on the TinyMCE editor.

Tag format

[snippet|type=drupal6|csid=13|tagstyle=block|lineNumbering=2|numberStart=301]

  • csid: The only required attribute (but untested if others are absent). The database ID
  • type : Only here for image styling inside TinyMCE, the filter uses the value stored in the database
  • tagstyle: Helps controls the formatting and this data is saved in the tag, see the GeSHi Filter docs for more details.
  • lineNumbering: See the GeSHi Filter docs.
  • numberStart : See the GeSHi Filter docs.

Dependencies

Release 1.1

This new release comes with an advanced code browser and editor.

You can now create code snippets when creating a new node as opposed to the previous version which worked when editing nodes only.

I do not see myself using any other editors, so if anyone wants to implement code snippet with another editor, please submit a patch.

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • chart icon8 sites report using this module
  • Created by Alan D. on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases