You are here

README.txt in Syntax Highlighter 6

Same filename and directory in other branches
  1. 8 README.txt
  2. 6.2 README.txt
  3. 7.2 README.txt
  4. 7 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 scan is only performed once and the location is cached. If
the library location is changed, visit admin/reports/status to force a rescan
and make sure the "Syntaxhighlighter javascript library" entry is green.

SETUP
-----

Enable the Syntaxhighlighter filter in an input format where you want to
highlight code using the syntaxhighlighter filter.

Order the filters as follow:

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


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

Go to admin/settings/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.behaviors.syntaxhighlighter(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 scan is only performed once and the location is cached. If
  26. the library location is changed, visit admin/reports/status to force a rescan
  27. and make sure the "Syntaxhighlighter javascript library" entry is green.
  28. SETUP
  29. -----
  30. Enable the Syntaxhighlighter filter in an input format where you want to
  31. highlight code using the syntaxhighlighter filter.
  32. Order the filters as follow:
  33. + HTML filter (or Wysiwyg filter or whatever HTML filter you use)
  34. + Syntax highlighter
  35. + Line break converter
  36. CONFIGURATION
  37. -------------
  38. Go to admin/settings/syntaxhighlighter to configure.
  39. USAGE
  40. -----
  41. Syntax highlight code in node or comment with:
  42. {syntaxhighlighter OPTIONS}
  43. any program code verbatim
  44. ...
  45. {/syntaxhighlighter}
  46. where OPTIONS is a Syntaxhighlighter options string. Visit
  47. http://alexgorbatchev.com/ to get details.
  48. If you use version 3.x of the javascript library, the OPTIONS string can be as follow:
  49. {syntaxhighlighter class="settings..." title="The title of your code block"}
  50. program code
  51. {/syntaxhighlighter}
  52. NOTE: it's not necessary to escape '<' and '>' in program code as required by
  53. the Syntaxhighlighter javascript library. The filter in the module does
  54. that for you. So you can leave your code totally unchanged.
  55. GET HELP
  56. --------
  57. Go to admin/help/syntaxhighlighter or filter/tips to get help
  58. About AJAX Usage
  59. ----------------
  60. On Ajax update, call Drupal.behaviors.syntaxhighlighter(context) where context
  61. is the element you have updated.
  62. Known problem:
  63. Autoloader and Ajax will not work if the brush is not already used on the page
  64. when the page is first loaded. For example: if on the page, there is no 'cpp'
  65. code block, then you ajax update some 'cpp' code block, then you will get "brush
  66. not found" error.
  67. If you need to do Ajax, it's probably best to not use autoloader.