Browse Source

babel: new function `org-babel-tangle-publish' allows for tangling during project publish

Eric Schulte 15 years ago
parent
commit
70ba21e699
1 changed files with 4 additions and 0 deletions
  1. 4 0
      contrib/babel/lisp/org-babel-tangle.el

+ 4 - 0
contrib/babel/lisp/org-babel-tangle.el

@@ -67,6 +67,10 @@ blocks by language."
   (interactive "fFile to tangle: \nP")
   (save-window-excursion (find-file file) (org-babel-tangle target-file lang)))
 
+(defun org-babel-tangle-publish (_ filename pub-dir)
+  "Tangle FILENAME and place the results in PUB-DIR."
+  (mapc (lambda (el) (copy-file el pub-dir t)) (org-babel-tangle-file filename)))
+
 (defun org-babel-tangle (&optional target-file lang)
   "Extract the bodies of all source code blocks from the current
 file into their own source-specific files.  Optional argument