emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
blob 66c342f5c34b9670046b2c8f89b4f6a76d39d77d 2263 bytes (raw)
name: contrib/lisp/test-org-export-preproc.el 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 
(require 'org-export-generic)

(defun test-preproc ()
  (interactive)
  (let ((string
         (let ((region
                (buffer-substring
                 (if (org-region-active-p) (region-beginning) (point-min))
                 (if (org-region-active-p) (region-end) (point-max))))
               (opt-plist (org-combine-plists (org-default-export-plist)
                                              (org-infile-export-plist)))
               (export-plist '("tikiwiki" :file-suffix ".txt" :key-binding 85 :header-prefix "" :header-suffix "" :title-format "-= %s =-\n" :date-export nil :toc-export nil :body-header-section-numbers nil :body-section-prefix "\n" :body-section-header-prefix
                               ("! " "!! " "!!! " "!!!! " "!!!!! " "!!!!!! " "!!!!!!! ")
                               :body-section-header-suffix
                               (" \n" " \n" " \n" " \n" " \n" " \n")
                               :body-line-export-preformated t :body-line-format "%s " :body-line-wrap nil :body-line-fixed-format " %s\n" :body-list-format "* %s\n" :body-number-list-format "# %s\n" :blockquote-start "\n^\n" :blockquote-end "^\n\n" :body-newline-paragraph "\n" :bold-format "__%s__" :italic-format "''%s''" :underline-format "===%s===" :strikethrough-format "--%s--" :code-format "-+%s+-" :verbatim-format "~pp~%s~/pp~")))
    (org-export-preprocess-string
		  region
		  :for-ascii t
		  :skip-before-1st-heading
		  (plist-get opt-plist :skip-before-1st-heading)
		  :drawers (plist-get export-plist :drawers-export)
		  :tags (plist-get export-plist :tags-export)
		  :priority (plist-get export-plist :priority-export)
		  :footnotes (plist-get export-plist :footnotes-export)
		  :timestamps (plist-get export-plist :timestamps-export)
		  :todo-keywords (plist-get export-plist :todo-keywords-export)
		  :verbatim-multiline t
		  :select-tags (plist-get export-plist :select-tags-export)
		  :exclude-tags (plist-get export-plist :exclude-tags-export)
                  :emph-multiline t
		  :archived-trees
		  (plist-get export-plist :archived-trees-export)
		  :add-text (plist-get opt-plist :text)))))
    (save-excursion
      (org-pop-to-buffer-same-window "*preproc-temp*")
      (point-max)
      (insert string))))

debug log:

solving 66c342f ...
found 66c342f in https://git.savannah.gnu.org/cgit/emacs/org-mode.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).