(let ((counter 0)) (defun ox-mrkup-filter-src-block (text back-end info) (let* ((url (save-nth-src-block counter (plist-get info :parse-tree))) (output (format "%s Open the code " text url))) (setq counter (+ counter 1)) output)) (let ((org-export-filter-src-block-functions '(ox-mrkup-filter-src-block)) (async nil) (subtreep nil) (visible-only nil) (body-only t) (ext-plist '())) (org-html-export-as-html async subtreep visible-only body-only ext-plist)) ; now get the output into the org output (switch-to-buffer "*Org HTML Export*") (buffer-string))