Uploaded image for project: 'ODF Toolkit'
  1. ODF Toolkit
  2. ODFTOOLKIT-329

Add a new Simple API to generate a table of content in text document

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.5-incubating
    • 0.6-incubating
    • simple api
    • None

    Description

      Dear all,
      I want to generate a table of content by ODF toolkit Simple API. But it seems that there doesn't exist such method. So I proposal to add a new API createTOC to Simple API.
      Specification: parameters for the new API are: 1. position/location of TOC, 2. TOC style to be used
      ODFToolkit API: TextDocument.createTOC(positionElement, TOCStyle).

      Discuss with Rob Weir:
      Rob:
      Also, it would be good to discuss how you will enter a ToC. If you
      do this operation in a word processor, like OpenOffice, you see it
      does two things:

      1) Enter the markup for <text:table-of-content> that defines the
      structure and style relations for the table of contents.

      2) Gather the header text from elsewhere in the document and enter
      that, along with page references, into a <text:index-body>

      Doing #1 is easy. But #2 is very difficult. Why? Because until you
      do a full layout of the document, taking into account font metrics,
      line breaking algorithms, hyphenation, image positioning, "orphan and
      widow" rules, etc., you don't know what content is on which page.

      DaLi: yeah, you are right, the page number will be difficult issue.

      Rob:
      So the easiest thing is to just do #1 and then have the user do an
      "Update Table" operation in the word process the next time the
      document is loaded.

      Dali:I will try to do #1 first.

      Rob:
      Next easiest is to collect the header text to put in the ToC, but not
      try to calculate the page numbers, leaving that to be calculated when
      the document is loaded in a full word processor.

      Dali:After finish #1, will consider this.

      Any comments are welcome

      Attachments

        1. tocsupport.patch
          28 kB
          Da Li Liu

        Activity

          People

            liudali Da Li Liu
            liudali Da Li Liu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 672h
                672h
                Remaining:
                Remaining Estimate - 672h
                672h
                Logged:
                Time Spent - Not Specified
                Not Specified