Function: org-texinfo-src-block

org-texinfo-src-block is a byte-compiled function defined in ox-texinfo.el.gz.

Signature

(org-texinfo-src-block SRC-BLOCK CONTENTS INFO)

Documentation

Transcode a SRC-BLOCK element from Org to Texinfo.

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

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-texinfo.el.gz
;;;; Src Block

(defun org-texinfo-src-block (src-block _contents info)
  "Transcode a SRC-BLOCK element from Org to Texinfo.
CONTENTS holds the contents of the item.  INFO is a plist holding
contextual information."
  (let* ((lisp (string-match-p
                "lisp"
		(or (org-element-property :language src-block) "")))
	 (code (org-texinfo--sanitize-content
		(org-export-format-code-default src-block info)))
	 (value (format
		 (if lisp "@lisp\n%s@end lisp" "@example\n%s@end example")
		 code))
	 (caption (org-export-get-caption src-block))
	 (shortcaption (org-export-get-caption src-block t)))
    (if (not (or caption shortcaption)) value
      (org-texinfo--wrap-float value
			       info
			       (org-export-translate "Listing" :utf-8 info)
			       (org-texinfo--get-node src-block info)
			       caption
			       shortcaption))))