You are here

README.txt in Table of Contents 7

Same filename and directory in other branches
  1. 5.2 README.txt
  2. 5 README.txt
  3. 6.3 README.txt
  4. 6.2 README.txt
  5. 7.2 README.txt
Table of Contents Module 3.x
============================

This is a module to generate a jQuery enabled mediawiki-like collapsible table
of contents section based on header tags.

Project Page: http://drupal.org/project/tableofcontents

Written by Andrew Berry with many contributions: andrewberry@sentex.net,
  http://drupal.org/user/71291

Enhanced for Drupal 6.x by Alexis Wilke, alexis@m2osw.com

Sponsors have included the University of Guelph Central Student Association
(http://www.csaonline.ca/), Pinchin Environmental (http://www.pinchin.com/)
and Made to Order Software Corp. (http://www.m2osw.com/)

Notable features:
	- Preserves attributes on the header tags
	- Checks for existing ID on headers and uses that if found (if none, creates one).
	- Handles duplicate heading titles cleanly when generating ID's.
	- jQuery script to make the Table of Contents collapsible. Currently using
	  the slideToggle function. Simply change line 4 of tableofcontents.js to
	  use a different transition. For more information on jquery and
	  transitions, see http://visualjquery.com.
	- Configurable: minimum and maximum heading levels, numbering, back to top, title.
	- Able to configure options across the site, or on a per-TOC basis.
	- Sensible default theming and CSS. Both can be easily overridden in your
	  theme to make each Table of Contents look as you want.

1. Installation
---------------
a. place the contents of the tableofcontents directory in your modules directory. 
b. enable Table of Contents and Heading Anchors at admin/modules
c. enable the filters itself at admin/input formats, and add each of the desired
   filters to your input types. Be sure to set headinganchors to be before the 
   tableofcontents filter.
d. If you are using Drupal 6, or the HTML Corrector Filter in Drupal 5, the
   HTML Corrector filter must be placed *after* the Table of Contents filter.
   This is due to a bug in the HTML Corrector filter, which is included in
   Drupal 6: http://drupal.org/node/222926. Once this bug is fixed, then it
   will be able to be placed before these filters, ensuring that code being
   processed is correct.

2. Use
------
Place the table of contents marker ([toc ...]) at any point in a
page to generate a table of contents at that location. It may be used multiple
times for muliple table of contents. Different options can be used for each
different marker. However, the hide/show capability only works with all or
nothing. Several options are supported with the following syntax:

[toc option:value; ...]

Available options:

a. hidden: true or false; useful to make sure the automatic table of content
   is not used on a given page

b. title: Override the default "Table of Contents" title (or what you configured
   in your filter.) This setting is piped through t() for translation.

c. list: Choose an ordered list (ol) or an unordered list (ul). Note that numbering
   as defined in your Input format settings is prefered.

c. minlevel: The minimum heading level for table of contents entries. Defaults to <h2>

d. maxlevel: The maximum heading level for table of contents entries. Defaults to <h3>

e. attachments: Choose to show attachments (1) or hide them (0). Defaults to 0.

f. hideshow: true or false; defaults to true meaning that the hide/show link will be
   visible.

g. collasped: true or false; defaults to false meaning that the table of contents is
   shown. Use true to collapse the table on load.

Example marker with default values:
   [toc list:ol; title:Summary; minlevel: 1; maxlevel: 6; attachments: 0]

Notes:

  Any boolean value (checkbox in your settings) accepts 'true', '1', 'false' or '0'.

  The last option is not required to be ending with a semi-colon.

  Multiple semi-colons one after another can be used safely.

  The title CANNOT include a semi-colon.

  Numbering cannot yet be tweaked with [toc ...] options.

3. Compatibility & Known issues
-------------------------------
The module is backward compatible and it supports the old syntax:

   <!-- tableofcontents [options] -->

In order to support some other modules generating table of contents using
[[TOC]], this module also accepts that syntax:

   [[TOC <options>]]

Note, however, that the table of contents module options should probably not
be used with [[TOC]].

Be careful, the HTML Filter will actually remove all the <script> tags.
This means the [toc] won't work properly. You need to insert the Table
of contents filter after the HTML Filter.


4. Removal / Deinstallation
---------------------------
No database tables are created. To remove the module, just disable and delete
the module. The <!--tableofcontents--> tags may be removed if desired however,
the tag is an HTML comment so it will be ignored by the renderer when the
module is deleted (or the filter disabled).

5. Notes
--------
As I extended this module for use on in a specific site, I haven't had the
chance to test extensively across many themes and/or browsers. So far, it seems
to work fine on Zen, Bluemarine, Garland, and Bluebreeze on IE7, FF3, and
Safari. Different themes render ol and ul differently so you will probably
need to tweak the CSS to get the ToC to display to your liking for a particular
theme.

File

README.txt
View source
  1. Table of Contents Module 3.x
  2. ============================
  3. This is a module to generate a jQuery enabled mediawiki-like collapsible table
  4. of contents section based on header tags.
  5. Project Page: http://drupal.org/project/tableofcontents
  6. Written by Andrew Berry with many contributions: andrewberry@sentex.net,
  7. http://drupal.org/user/71291
  8. Enhanced for Drupal 6.x by Alexis Wilke, alexis@m2osw.com
  9. Sponsors have included the University of Guelph Central Student Association
  10. (http://www.csaonline.ca/), Pinchin Environmental (http://www.pinchin.com/)
  11. and Made to Order Software Corp. (http://www.m2osw.com/)
  12. Notable features:
  13. - Preserves attributes on the header tags
  14. - Checks for existing ID on headers and uses that if found (if none, creates one).
  15. - Handles duplicate heading titles cleanly when generating ID's.
  16. - jQuery script to make the Table of Contents collapsible. Currently using
  17. the slideToggle function. Simply change line 4 of tableofcontents.js to
  18. use a different transition. For more information on jquery and
  19. transitions, see http://visualjquery.com.
  20. - Configurable: minimum and maximum heading levels, numbering, back to top, title.
  21. - Able to configure options across the site, or on a per-TOC basis.
  22. - Sensible default theming and CSS. Both can be easily overridden in your
  23. theme to make each Table of Contents look as you want.
  24. 1. Installation
  25. ---------------
  26. a. place the contents of the tableofcontents directory in your modules directory.
  27. b. enable Table of Contents and Heading Anchors at admin/modules
  28. c. enable the filters itself at admin/input formats, and add each of the desired
  29. filters to your input types. Be sure to set headinganchors to be before the
  30. tableofcontents filter.
  31. d. If you are using Drupal 6, or the HTML Corrector Filter in Drupal 5, the
  32. HTML Corrector filter must be placed *after* the Table of Contents filter.
  33. This is due to a bug in the HTML Corrector filter, which is included in
  34. Drupal 6: http://drupal.org/node/222926. Once this bug is fixed, then it
  35. will be able to be placed before these filters, ensuring that code being
  36. processed is correct.
  37. 2. Use
  38. ------
  39. Place the table of contents marker ([toc ...]) at any point in a
  40. page to generate a table of contents at that location. It may be used multiple
  41. times for muliple table of contents. Different options can be used for each
  42. different marker. However, the hide/show capability only works with all or
  43. nothing. Several options are supported with the following syntax:
  44. [toc option:value; ...]
  45. Available options:
  46. a. hidden: true or false; useful to make sure the automatic table of content
  47. is not used on a given page
  48. b. title: Override the default "Table of Contents" title (or what you configured
  49. in your filter.) This setting is piped through t() for translation.
  50. c. list: Choose an ordered list (ol) or an unordered list (ul). Note that numbering
  51. as defined in your Input format settings is prefered.
  52. c. minlevel: The minimum heading level for table of contents entries. Defaults to

  53. d. maxlevel: The maximum heading level for table of contents entries. Defaults to

  54. e. attachments: Choose to show attachments (1) or hide them (0). Defaults to 0.
  55. f. hideshow: true or false; defaults to true meaning that the hide/show link will be
  56. visible.
  57. g. collasped: true or false; defaults to false meaning that the table of contents is
  58. shown. Use true to collapse the table on load.
  59. Example marker with default values:
  60. [toc list:ol; title:Summary; minlevel: 1; maxlevel: 6; attachments: 0]
  61. Notes:
  62. Any boolean value (checkbox in your settings) accepts 'true', '1', 'false' or '0'.
  63. The last option is not required to be ending with a semi-colon.
  64. Multiple semi-colons one after another can be used safely.
  65. The title CANNOT include a semi-colon.
  66. Numbering cannot yet be tweaked with [toc ...] options.
  67. 3. Compatibility & Known issues
  68. -------------------------------
  69. The module is backward compatible and it supports the old syntax:
  70. In order to support some other modules generating table of contents using
  71. [[TOC]], this module also accepts that syntax:
  72. [[TOC ]]
  73. Note, however, that the table of contents module options should probably not
  74. be used with [[TOC]].
  75. Be careful, the HTML Filter will actually remove all the