You are here

README.txt in Syntax Highlighter 7

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

Step 1) Download the latest Syntax highlighter javascript library from
http://alexgorbatchev.com/, extract the content and place the entire directory
inside any of the following directories:

  -  sites/all/libraries
       Recommended. This is Drupal's standard third party library install location.
  -  profiles/{profilename}/libraries
       Recommended if this library is to be profile specific.
  -  Site-file-directory-path
       usually sites/<site_domain>/files. This location is not recommended.
       Only use this if you for some reason need to run different versions of
       the syntaxhighlighter library for different sites in your multi-site install.
  -  Inside the syntaxhighlighter module directory
       This is not recommended. It's only for backward compability.

Library directory can be nested in any sub-directory of any name **except 'src'**.
Do not use the 'src' directory name to store the library.

After install, you should have something like this:
       
  sites/all/libraries/syntaxhighlighter_3.0.83/...
  
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 only performed once
and the location is cached. If the library location is changed for any reason,
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 an input format where you want to
highlight code using the syntaxhighlighter filter.

Place the filters in the following relative ordering positions:

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

Note the "Line break converter" filter must be behind the "Syntax highlighter"
filter.

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

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

USAGE
-----

Syntax highlight code in node or comment with:

{syntaxhighlighter OPTIONS}
  any program code verbatim
  ...
{/syntaxhighlighter}

where OPTIONS is a Syntaxhighlighter options string. Visit
http://alexgorbatchev.com/ to get details.

If you use version 3.x of the javascript library, the OPTIONS string can be as follow:

  {syntaxhighlighter class="settings..." title="The title of your code block"}
    program code
  {/syntaxhighlighter}

NOTE: it's not necessary to escape '<' and '>' in program code as required by
the Syntaxhighlighter javascript library. The filter in the module does
that for you. So you can leave your code totally unchanged.


GET HELP
--------

Go to admin/help/syntaxhighlighter or filter/tips to get help


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 content and place the entire directory
  5. inside any of the following directories:
  6. - sites/all/libraries
  7. Recommended. This is Drupal's standard third party library install location.
  8. - profiles/{profilename}/libraries
  9. Recommended if this library is to be profile specific.
  10. - Site-file-directory-path
  11. usually sites//files. This location is not recommended.
  12. Only use this if you for some reason need to run different versions of
  13. the syntaxhighlighter library for different sites in your multi-site install.
  14. - Inside the syntaxhighlighter module directory
  15. This is not recommended. It's only for backward compability.
  16. Library directory can be nested in any sub-directory of any name **except 'src'**.
  17. Do not use the 'src' directory name to store the library.
  18. After install, you should have something like this:
  19. sites/all/libraries/syntaxhighlighter_3.0.83/...
  20. Note: If you want the toolbar with options to view source and flash-based copy
  21. to clipboard, you will need to use the older 2.x version. See http://alexgorbatchev.com/
  22. for details.
  23. WARNING!
  24. -------
  25. Library location is determined by file scan. This scan is only performed once
  26. and the location is cached. If the library location is changed for any reason,
  27. visit admin/reports/status to force a re-scan and make sure the "Syntax
  28. highlighter js library" status entry shows "Installed".
  29. Step 2) Enable the syntaxhighlighter module
  30. SETUP
  31. -----
  32. Enable the Syntaxhighlighter filter in an input format where you want to
  33. highlight code using the syntaxhighlighter filter.
  34. Place the filters in the following relative ordering positions:
  35. + HTML filter (or Wysiwyg filter or whatever HTML filter you use)
  36. + Syntax highlighter
  37. + Line break converter (Autop)
  38. Note the "Line break converter" filter must be behind the "Syntax highlighter"
  39. filter.
  40. CONFIGURATION
  41. -------------
  42. Go to admin/config/content/syntaxhighlighter to configure.
  43. USAGE
  44. -----
  45. Syntax highlight code in node or comment with:
  46. {syntaxhighlighter OPTIONS}
  47. any program code verbatim
  48. ...
  49. {/syntaxhighlighter}
  50. where OPTIONS is a Syntaxhighlighter options string. Visit
  51. http://alexgorbatchev.com/ to get details.
  52. If you use version 3.x of the javascript library, the OPTIONS string can be as follow:
  53. {syntaxhighlighter class="settings..." title="The title of your code block"}
  54. program code
  55. {/syntaxhighlighter}
  56. NOTE: it's not necessary to escape '<' and '>' in program code as required by
  57. the Syntaxhighlighter javascript library. The filter in the module does
  58. that for you. So you can leave your code totally unchanged.
  59. GET HELP
  60. --------
  61. Go to admin/help/syntaxhighlighter or filter/tips to get help
  62. About AJAX Usage
  63. ----------------
  64. On Ajax update, call Drupal.attachBehaviors(context) where context
  65. is the element you have updated.
  66. Known problem:
  67. Autoloader and Ajax will not work if the brush is not already used on the page
  68. when the page is first loaded. For example: if on the page, there is no 'cpp'
  69. code block, then you ajax update some 'cpp' code block, then you will get "brush
  70. not found" error.
  71. If you need to do Ajax, it's probably best to not use autoloader.