浏览代码

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 年之前
父节点
当前提交
bafffdc5f6
共有 3 个文件被更改,包括 5 次插入6 次删除
  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
       (org-lparse-bind-local-variables opt-plist)
       (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
        lines
        (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)
   (org-lparse-end-paragraph))
 
-(defun org-odt-begin-toc (lang-specific-heading)
+(defun org-odt-begin-toc (lang-specific-heading max-level)
   (insert
    (format "
     <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>
-" lang-specific-heading))
-
+" max-level lang-specific-heading))
   (loop for level from 1 upto 10
 	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)
   (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\">")
   (insert
    (org-lparse-format 'HEADING lang-specific-heading