Function: org-ascii-table

org-ascii-table is a byte-compiled function defined in ox-ascii.el.gz.

Signature

(org-ascii-table TABLE CONTENTS INFO)

Documentation

Transcode a TABLE element from Org to ASCII.

CONTENTS is the contents of the table. INFO is a plist holding contextual information.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-ascii.el.gz
;;;; Table

(defun org-ascii-table (table contents info)
  "Transcode a TABLE element from Org to ASCII.
CONTENTS is the contents of the table.  INFO is a plist holding
contextual information."
  (let ((caption (org-ascii--build-caption table info))
	(caption-above-p (plist-get info :ascii-caption-above)))
    (org-ascii--justify-element
     (concat
      ;; Possibly add a caption string above.
      (and caption caption-above-p (concat caption "\n"))
      ;; Insert table.  Note: "table.el" tables are left unmodified.
      (cond ((eq (org-element-property :type table) 'org) contents)
	    ((and (plist-get info :ascii-table-use-ascii-art)
		  (eq (plist-get info :ascii-charset) 'utf-8)
		  (org-require-package 'ascii-art-to-unicode nil 'noerror))
	     (with-temp-buffer
	       (insert (org-remove-indentation
			(org-element-property :value table)))
	       (goto-char (point-min))
	       (aa2u)
	       (goto-char (point-max))
	       (skip-chars-backward " \r\t\n")
	       (buffer-substring (point-min) (point))))
	    (t (org-remove-indentation (org-element-property :value table))))
      ;; Possible add a caption string below.
      (and (not caption-above-p) caption))
     table info)))