mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-21 06:55:35 +00:00
expand noweb refs when ":noweb yes" during export
* lisp/ob-exp.el (org-babel-exp-do-export): Use `org-babel-exp-code' to generate code block output. (org-babel-exp-code): Re-create the code block body for exporting source code.
This commit is contained in:
parent
2a8fbc4b46
commit
72c154e38e
@ -238,9 +238,17 @@ The function respects the value of the :exports header argument."
|
||||
(clean () (unless (eq type 'inline) (org-babel-remove-result info))))
|
||||
(case (intern (or (cdr (assoc :exports (nth 2 info))) "code"))
|
||||
('none (silently) (clean) "")
|
||||
('code (silently) (clean) nil)
|
||||
('code (silently) (clean) (org-babel-exp-code info))
|
||||
('results (org-babel-exp-results info type nil hash) "")
|
||||
('both (org-babel-exp-results info type nil hash) nil))))
|
||||
('both (org-babel-exp-results info type nil hash)
|
||||
(org-babel-exp-code info)))))
|
||||
|
||||
(defun org-babel-exp-code (info)
|
||||
"Return the original code block formatted for export."
|
||||
(org-fill-template "#+BEGIN_SRC %lang%flags\n%body\n#+END_SRC\n"
|
||||
`(("lang" . ,(nth 0 info))
|
||||
("flags" . ,(when-let (f (nth 3 info)) (concat " " f)))
|
||||
("body" . ,(nth 1 info)))))
|
||||
|
||||
(defun org-babel-exp-results (info type &optional silent hash)
|
||||
"Evaluate and return the results of the current code block for export.
|
||||
|
Loading…
Reference in New Issue
Block a user