Browse Source

org-odt.el: Export TOC max-level information.

The TOC max level which could be specified by user is lost during the
export operation. However, this information could be useful in particular
with the ODT exporter. So if another script work on the ODT afterward and
ask to re-compute the TOC, the new TOC will keep this max level.

TINYCHANGE.
Jeremy Compostella 13 years ago
parent
commit
bafffdc5f6
3 changed files with 5 additions and 6 deletions
  1. 1 1
      contrib/lisp/org-lparse.el
  2. 3 4
      contrib/lisp/org-odt.el
  3. 1 1
      contrib/lisp/org-xhtml.el

+ 1 - 1
contrib/lisp/org-lparse.el

@@ -1886,7 +1886,7 @@ See `org-xhtml-entity-format-callbacks-alist' for more information."
     (with-temp-buffer
     (with-temp-buffer
       (org-lparse-bind-local-variables opt-plist)
       (org-lparse-bind-local-variables opt-plist)
       (erase-buffer)
       (erase-buffer)
-      (org-lparse-begin 'TOC (nth 3 (plist-get opt-plist :lang-words)))
+      (org-lparse-begin 'TOC (nth 3 (plist-get opt-plist :lang-words)) umax-toc)
       (setq
       (setq
        lines
        lines
        (mapcar
        (mapcar

+ 3 - 4
contrib/lisp/org-odt.el

@@ -908,14 +908,13 @@ styles congruent with the ODF-1.2 specification."
 (defun org-odt-end-footnote-definition (n)
 (defun org-odt-end-footnote-definition (n)
   (org-lparse-end-paragraph))
   (org-lparse-end-paragraph))
 
 
-(defun org-odt-begin-toc (lang-specific-heading)
+(defun org-odt-begin-toc (lang-specific-heading max-level)
   (insert
   (insert
    (format "
    (format "
     <text:table-of-content text:style-name=\"Sect2\" text:protected=\"true\" text:name=\"Table of Contents1\">
     <text:table-of-content text:style-name=\"Sect2\" text:protected=\"true\" text:name=\"Table of Contents1\">
-     <text:table-of-content-source text:outline-level=\"10\">
+     <text:table-of-content-source text:outline-level=\"%d\">
       <text:index-title-template text:style-name=\"Contents_20_Heading\">%s</text:index-title-template>
       <text:index-title-template text:style-name=\"Contents_20_Heading\">%s</text:index-title-template>
-" lang-specific-heading))
-
+" max-level lang-specific-heading))
   (loop for level from 1 upto 10
   (loop for level from 1 upto 10
 	do (insert (format
 	do (insert (format
 		    "
 		    "

+ 1 - 1
contrib/lisp/org-xhtml.el

@@ -1067,7 +1067,7 @@ that uses these same face definitions."
   (org-lparse-begin-list-item 'unordered)
   (org-lparse-begin-list-item 'unordered)
   (insert toc-entry))
   (insert toc-entry))
 
 
-(defun org-xhtml-begin-toc (lang-specific-heading)
+(defun org-xhtml-begin-toc (lang-specific-heading max-level)
   (org-lparse-insert-tag "<div id=\"table-of-contents\">")
   (org-lparse-insert-tag "<div id=\"table-of-contents\">")
   (insert
   (insert
    (org-lparse-format 'HEADING lang-specific-heading
    (org-lparse-format 'HEADING lang-specific-heading