Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-4001

ToC macro with scope=local indents the ToC items to match the level of the current section

    XMLWordPrintable

Details

    • toc macro scope local
    • Unit
    • Unknown

    Description

      Consider the following XWiki 2.0 content:

      = S1 =
      
      == S1.1 ==
      
      {{toc scope="local"/}}
      
      === S1.1.1 ===
      
      ==== S1.1.1.1 ====
      
      === S1.1.2 ===
      
      == S1.2 ==
      

      The ToC macro generates:

      *
      ** S1.1.1
      *** S1.1.1.1
      ** S1.1.2
      

      which means that the level of each list item matches the level of the corresponding section (ToC macro has start=2 by default). While this is good for scope=page, for scope=local the list items don't have to be indented: their level should be relative to the level of the current section:

      * S1.1.1
      ** S1.1.1.1
      * S1.1.2
      

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            mflorea Marius Dumitru Florea
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: