You are here

README.txt in Syntax Highlighter 7.2

Same filename and directory in other branches
  1. 8 README.txt
  2. 6.2 README.txt
  3. 6 README.txt
  4. 7 README.txt
INSTALLATION
-------------

Step 1) Download the latest Syntax highlighter javascript library from
http://alexgorbatchev.com/, extract the contents, rename the directory to
"syntaxhighlighter" and place the entire directory inside any of the following
locations:

  -  sites/all/libraries
       Recommended. This is Drupal's standard third party library install location.
  -  sites/[sitename]/libraries
       Recommended if this library is to be site specific.
  -  profiles/[profilename]/libraries
       Recommended if this library is to be profile specific.
  -  Inside the syntaxhighlighter module directory
       This is not recommended. It's only for backward compability.
  -  If "libraries" module is installed (optional), then you can place the library
     in any of the locations supported by that module


After install, you should have something like this:
       
  sites/all/libraries/syntaxhighlighter/...

so that shCore.js is located at:

  sites/all/libraries/syntaxhighlighter/scripts/shCore.js
  
Note: If you want the toolbar with options to view source and flash-based copy
to clipboard, you will need to use the older 2.x version. See http://alexgorbatchev.com/
for details.

       
WARNING!
-------
Library location is determined by file scan. This scan is performed only once
and the location is cached. If the library location is changed for any reason
(such as after upgrading the js lib), visit admin/reports/status to force a
re-scan and make sure the "Syntax highlighter js library" status entry shows
"Installed".

Step 2) Enable the syntaxhighlighter module.


SETUP
-----

Enable the Syntaxhighlighter filter in a text format where you want to
highlight code using the syntaxhighlighter filter.  You do not need to enable
the Syntaxhighlighter filter in any text format that do not do HTML filtering
(e.g. Full HTML)

IMPORTANT! Place the filters in the following relative ordering positions:

+ Limit allowed HTML tags filter (or Wysiwyg filter or whatever HTML filter you use)
+ Syntax highlighter
+ Line break converter (Autop)


CONFIGURATION
-------------

Go to admin/config/content/syntaxhighlighter to configure.


USAGE
-----

Mark up code with as specified in http://alexgorbatchev.com/.

NOTE: you must make sure your markup is proper HTML. This means if your code
have any HTML tags or entities in them, you need to change the '<' character
to '&lt;' (e.g. <script> to &lt;script>), convert '&' in any HTML entity to
'&amp;' (e.g. &gt; to &amp;gt;).


About AJAX Usage
----------------

On Ajax update, call Drupal.attachBehaviors(context) where context
is the element you have updated.

Known problem:

Autoloader and Ajax will not work if the brush is not already used on the page
when the page is first loaded. For example: if on the page, there is no 'cpp'
code block, then you ajax update some 'cpp' code block, then you will get "brush
not found" error.

If you need to do Ajax, it's probably best to not use autoloader.

File

README.txt
View source
  1. INSTALLATION
  2. -------------
  3. Step 1) Download the latest Syntax highlighter javascript library from
  4. http://alexgorbatchev.com/, extract the contents, rename the directory to
  5. "syntaxhighlighter" and place the entire directory inside any of the following
  6. locations:
  7. - sites/all/libraries
  8. Recommended. This is Drupal's standard third party library install location.
  9. - sites/[sitename]/libraries
  10. Recommended if this library is to be site specific.
  11. - profiles/[profilename]/libraries
  12. Recommended if this library is to be profile specific.
  13. - Inside the syntaxhighlighter module directory
  14. This is not recommended. It's only for backward compability.
  15. - If "libraries" module is installed (optional), then you can place the library
  16. in any of the locations supported by that module
  17. After install, you should have something like this:
  18. sites/all/libraries/syntaxhighlighter/...
  19. so that shCore.js is located at:
  20. sites/all/libraries/syntaxhighlighter/scripts/shCore.js
  21. Note: If you want the toolbar with options to view source and flash-based copy
  22. to clipboard, you will need to use the older 2.x version. See http://alexgorbatchev.com/
  23. for details.
  24. WARNING!
  25. -------
  26. Library location is determined by file scan. This scan is performed only once
  27. and the location is cached. If the library location is changed for any reason
  28. (such as after upgrading the js lib), visit admin/reports/status to force a
  29. re-scan and make sure the "Syntax highlighter js library" status entry shows
  30. "Installed".
  31. Step 2) Enable the syntaxhighlighter module.
  32. SETUP
  33. -----
  34. Enable the Syntaxhighlighter filter in a text format where you want to
  35. highlight code using the syntaxhighlighter filter. You do not need to enable
  36. the Syntaxhighlighter filter in any text format that do not do HTML filtering
  37. (e.g. Full HTML)
  38. IMPORTANT! Place the filters in the following relative ordering positions:
  39. + Limit allowed HTML tags filter (or Wysiwyg filter or whatever HTML filter you use)
  40. + Syntax highlighter
  41. + Line break converter (Autop)
  42. CONFIGURATION
  43. -------------
  44. Go to admin/config/content/syntaxhighlighter to configure.
  45. USAGE
  46. -----
  47. Mark up code with as specified in http://alexgorbatchev.com/.
  48. NOTE: you must make sure your markup is proper HTML. This means if your code
  49. have any HTML tags or entities in them, you need to change the '<' character
  50. to '<' (e.g.