her.esy.fun/src/posts/0011-export-tangle-names/org_html_export_show_tangle.el
Yann Esposito (Yogsototh) d938e25503
add tangle to code block
2020-02-29 17:08:05 +01:00

10 lines
420 B
EmacsLisp

(defun my-add-link-to-tangled-files (backend)
"Add a link just before source code block with tangled files.
BACKEND is the export backend. Used as symbol."
(while ;; (re-search-forward )
(re-search-forward "^\\( *\\)#\\+begin_src .*:tangle \\([^\s\n]*\\)" nil t)
(replace-match "\\1#+CAPTION: [[./\\2][=\\2=]]\n\\&")))
(add-hook 'org-export-before-processing-hook
'my-add-link-to-tangled-files)