diff options
Diffstat (limited to 'doc/ox-texinfo+.el')
-rw-r--r-- | doc/ox-texinfo+.el | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/ox-texinfo+.el b/doc/ox-texinfo+.el new file mode 100644 index 00000000..c8f4f6d4 --- /dev/null +++ b/doc/ox-texinfo+.el @@ -0,0 +1,20 @@ +(require 'ox-texinfo) + +(defun org-texinfo-keyword+ (keyword contents info) + (let* ((v (org-element-property :value keyword)) + (k (org-element-property :key keyword)) + (c (org-texinfo-keyword keyword contents info))) + (if c c + (when (string-match "\\(?:\\`\\(?1:.+\\)INDEX\\'\\)" k) + (format "@%sindex %s" (downcase (match-string 1 k)) v))))) + +(defun org-texinfo-export-to-texinfo+ () + (interactive) + (let ((outfile (org-export-output-file-name ".texi")) + (org-export-coding-system org-texinfo-coding-system)) + (org-export-to-file 'my-texinfo outfile))) + +(org-export-define-derived-backend 'my-texinfo 'texinfo + :translate-alist '((keyword . org-texinfo-keyword+))) + +(provide 'ox-texinfo+) |