Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
MojoMojo::Formatter::TUser)Contributed Perl DocumenMojoMojo::Formatter::TOC(3)

   module_loaded
       Return true if the module is loaded.

NAME
       MojoMojo::Formatter::TOC	- generate table of contents

DESCRIPTION
       This formatter will replace "{{toc}}" with a table of contents, using
       HTML::GenToc. If	you don't want an element to be	included in the	TOC,
       make it have "class="notoc""

METHODS
   format_content_order
       The TOC formatter expects HTML input so it needs	to run after the main
       formatter. Since	comment-type formatters	(order 91) could add a heading
       for the comment section,	the TOC	formatter will run with	a priority of
       95.

   format_content
       Calls the formatter. Takes a ref	to the content as well as the context
       object.	The syntax for the TOC plugin invocation is:

	 {{toc M- }}	 # start from Header level M
	 {{toc -N }}	 # stop	at Header level	N
	 {{toc M-N }}	 # process only	header levels M..N

       where M is the minimum heading level to include in the TOC, and N is
       the maximum level (depth). For example, suppose you only	have one H1 on
       the page	so it doesn't make sense to add	it to the TOC; also, assume
       you and don't want to include any headers smaller than H3. The {{toc}}
       markup to achieve that would be:

	 {{toc 2-3}}

       Defaults	to 1-6.

   SEO-friendly	anchors
       Anchors should be generated with	SEO- (and human-) friendly names, i.e.
       out of the entire token text, instead of	being numeric or reduced to
       the first word(s) of the	token.	In the spirit of
       http://seo2.0.onreact.com/top-10-fatal-url-design-mistakes, compare:

	 http://beachfashion.com/photos/Pamela_Anderson#In_red_swimsuit_in_Baywatch
	   vs.
	 http://beachfashion.com/photos/Pamela_Anderson#in

       "Which one speaks your language more, which one will you	rather click?"

       The anchor names	generated are compliant	with XHTML1.0 Strict. Also,
       per the HTML 4.01 spec, anchor names should be restricted to ASCII
       characters and anchors that differ only in case may not appear in the
       same document. In particular, an	anchor name may	be defined only	once
       in a document (logically, because otherwise the user agent wouldn't
       know which #foo to scroll to).  This is currently a problem with
       HTML::Toc v1.11,	which doesn't have support for passing the already
       existing	anchors	to the "templateAnchorName" sub.

   assembleAnchorName
	http://search.cpan.org/dist/HTML-Toc/Toc.pod#templateAnchorName

SEE ALSO
       MojoMojo	and Module::Pluggable::Ordered.

AUTHORS
       Dan Dascalescu, <http://dandascalescu.com>

LICENSE
       This library is free software. You can redistribute it and/or modify it
       under the same terms as Perl itself.

perl v5.24.1			  2010-05-23	   MojoMojo::Formatter::TOC(3)

NAME | DESCRIPTION | METHODS | SEE ALSO | AUTHORS | LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=MojoMojo::Formatter::TOC&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help