www-infrastructure-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Dickinson (JIRA)" <j...@apache.org>
Subject [jira] [Created] (INFRA-3938) Apache CMS does not create correctly nested TOC structure from document headings hierarchy
Date Mon, 19 Sep 2011 23:09:08 GMT
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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message