ox-texinfo.el: Add support for @appendix headlines

* lisp/ox-texinfo.el: Included support for appendices.

To include appendices, use a non-nil value for the :APPENDIX: property
of a headline.  This headline will be exported at the appropriate
level as an appendix.
This commit is contained in:
Jonathan Leech-Pepin 2013-02-25 10:14:53 -05:00
parent 696ca23cfb
commit d299ae53dd

View file

@ -907,6 +907,8 @@ holding contextual information."
(class-sectionning (assoc class org-texinfo-classes)) (class-sectionning (assoc class org-texinfo-classes))
;; Find the index type, if any ;; Find the index type, if any
(index (org-element-property :INDEX headline)) (index (org-element-property :INDEX headline))
;; Check if it is an appendix
(appendix (org-element-property :APPENDIX headline))
;; Retrieve headline text ;; Retrieve headline text
(text (org-texinfo--sanitize-headline (text (org-texinfo--sanitize-headline
(org-element-property :title headline) info)) (org-element-property :title headline) info))
@ -949,13 +951,20 @@ holding contextual information."
((stringp sec) sec) ((stringp sec) sec)
;; (numbered-section . unnumbered-section) ;; (numbered-section . unnumbered-section)
((not (consp (cdr sec))) ((not (consp (cdr sec)))
;; If an index, always unnumbered (cond
(if index ;;If an index, always unnumbered
(concat menu node (cdr sec) "\n%s") (index
(concat menu node (cdr sec) "\n%s"))
(appendix
(concat menu node (replace-regexp-in-string
"unnumbered"
"appendix"
(cdr sec)) "\n%s"))
;; Otherwise number as needed. ;; Otherwise number as needed.
(t
(concat menu node (concat menu node
(funcall (funcall
(if numberedp #'car #'cdr) sec) "\n%s")))))) (if numberedp #'car #'cdr) sec) "\n%s")))))))
(todo (todo
(and (plist-get info :with-todo-keywords) (and (plist-get info :with-todo-keywords)
(let ((todo (org-element-property :todo-keyword headline))) (let ((todo (org-element-property :todo-keyword headline)))