Open topic with navigation

# Count Sections

For each document, this Lua script adds a total sections count to the title, and replaces the content of each section with the section number.

    function handler(document)
       local section_count = 0;
       local section = document;

       while section do
          section_count = section_count + 1;
          section:setContent("Section "..section_count);
          section = section:getNextSection();
       end

       local title = document:getFieldValue("TITLE");

       if title == nil then title = "" end
       document:setFieldValue("TITLE", title .." Total Sections "
          ..section_count);

       return true;
    end

© 2016 Hewlett Packard Enterprise Development LP | Send documentation feedback to HPE Close We welcome your comments! To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to AutonomyTPFeedback@hpe.com. Product: Topic Title: Help Topic: Feedback:

_HP_HTML5_bannerTitle.htm