You are viewing a plain text version of this content. The canonical link for it is here.
Posted to infrastructure-issues@apache.org by "David Fisher (Commented) (JIRA)" <ji...@apache.org> on 2012/01/03 21:00:39 UTC

[jira] [Commented] (INFRA-3938) Apache CMS does not create correctly nested TOC structure from document headings hierarchy

    [ https://issues.apache.org/jira/browse/INFRA-3938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178987#comment-13178987 ] 

David Fisher commented on INFRA-3938:
-------------------------------------

What happens if the page uses the headerid extension's header_level parameter?

{code}
header_level: 2
{code}

                
> Apache CMS does not create correctly nested TOC structure from document headings hierarchy
> ------------------------------------------------------------------------------------------
>
>                 Key: INFRA-3938
>                 URL: https://issues.apache.org/jira/browse/INFRA-3938
>             Project: Infrastructure
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Website
>         Environment: Apache CMS
>            Reporter: Ian Dickinson
>
> I'm using the CMS to create our podling's web site. According to http://www.apache.org/dev/cmsref.html#markdown, I can use the [TOC] element to create a table of contents from the headers in the document, but I'm having a problem with it. Consider the following document:
>     Title: TOC test
>     
>     The title above will generate an h1 element from the CMS scripts
>     
>     [TOC]
>     
>     ## I am the first h2
>     lorem fubarum
>     
>     ## I am the second h2
>     lorem fubarum
>     
>     ### I am the first h3
>     lorem fubarum
>     
>     ## And I'm back to h2
>     lorem fubarum
> The structure created by the TOC element does not match the hierarchy in the document. This is what I get, using a local copy of the CMS scripts, SVN update'd today (NB I hand-edited the indenting for clarity):
>     <div id="content">
>     <h1 class="title">TOC test</h1>
>     <p>The title above will generate an h1 element from the CMS scripts</p>
>     
>     <div class="toc">
>     <ul>
>       <li><a href="#i_am_the_first_h2">I am the first h2</a>
>          <ul>
>            <li><a href="#i_am_the_second_h2">I am the second h2</a>
>              <ul>
>                <li><a href="#i_am_the_first_h3">I am the first h3</a></li>
>              </ul>
>            </li>
>            <li><a href="#and_im_back_to_h2">And I'm back to h2</a></li>
>          </ul>
>       </li>
>     </ul>
>     </div>
>     
>     <h2 id="i_am_the_first_h2">I am the first h2</h2>
>     <p>lorem fubarum</p>
>     <h2 id="i_am_the_second_h2">I am the second h2</h2>
>     <p>lorem fubarum</p>
>     <h3 id="i_am_the_first_h3">I am the first h3</h3>
>     <p>lorem fubarum</p>
>     <h2 id="and_im_back_to_h2">And I'm back to h2</h2>
>     <p>lorem fubarum</p>
>     </div>
> It seems that the first encountered sub-head always becomes the parent of the other sub-heads of the document, regardless of their relative hierarchy levels. Since the `Title:` element will automatically create an h1 for the page, it seems natural to me that the remaining heads should start at h2, but I wonder if this is confusing the markdown TOC module.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira