Function: org-odt--format-toc

org-odt--format-toc is a byte-compiled function defined in ox-odt.el.gz.

Signature

(org-odt--format-toc TITLE ENTRIES DEPTH)

Documentation

Return a table of contents.

TITLE is the title of the table, as a string, or nil. ENTRIES is the contents of the table, as a string. DEPTH is an integer specifying the depth of the table.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-odt.el.gz
;;;; Table of Contents

(defun org-odt--format-toc (title entries depth)
  "Return a table of contents.
TITLE is the title of the table, as a string, or nil.  ENTRIES is
the contents of the table, as a string.  DEPTH is an integer
specifying the depth of the table."
  (concat
   "
<text:table-of-content text:style-name=\"OrgIndexSection\" text:protected=\"true\" text:name=\"Table of Contents\">\n"
   (format "  <text:table-of-content-source text:outline-level=\"%d\">" depth)
   (and title
	(format "
    <text:index-title-template text:style-name=\"Contents_20_Heading\">%s</text:index-title-template>
"
		title))

   (let ((levels (number-sequence 1 10)))
     (mapconcat
      (lambda (level)
	(format
	 "
      <text:table-of-content-entry-template text:outline-level=\"%d\" text:style-name=\"Contents_20_%d\">
       <text:index-entry-link-start text:style-name=\"Internet_20_link\"/>
       <text:index-entry-chapter/>
       <text:index-entry-text/>
       <text:index-entry-link-end/>
      </text:table-of-content-entry-template>\n"
	 level level)) levels ""))
   "
  </text:table-of-content-source>
  <text:index-body>"
   (and title
	(format "
    <text:index-title text:style-name=\"Sect1\" text:name=\"Table of Contents1_Head\">
      <text:p text:style-name=\"Contents_20_Heading\">%s</text:p>
    </text:index-title>\n"
		title))
   entries
   "
  </text:index-body>
</text:table-of-content>"))