            (goto-char (point-min))
            (if (search-forward "#+TITLE:" nil t nil)
                (beginning-of-line 2)
-             (error "Can't find #+TITLE:"))
+             (error (format "Can't find #+TITLE: in %s"
+                            (buffer-file-name))))
            (insert (concat head-css-extra-readtheorg-head
                            (f-relative user-emacs-directory
                                        (file-name-directory filename))
                            head-css-extra-readtheorg-tail)))))
 
 (defun spacemacs//pub-doc-html-advice (origfunc &rest args)
+  "Wrapper for `org-html-publish-to-html' use it to insert
+preprocessors for the exported .org files."
   (save-current-buffer
     (save-excursion
       (let* ((filename (car (nthcdr 1 args)))

(require 's)
(require 'dash)
(require 'f)

(defvar spacemacs--category-names
  '(("config-files" . "Configuration files")

        (with-temp-buffer
          (save-match-data
            (insert-file-contents filename t)
            ;; ===========Add preprocessors here===============
            (spacemacs//add-org-meta-readtheorg-css filename)
            (spacemacs//toc-org-unhrefify-toc)
            (spacemacs//reroot-links)
            (spacemacs//org-heading-annotate-custom-id)
            (apply origfunc args)
            (not-modified)))
        ;; Restore `buffer-file-name' for the buffers that previously visited the org files.
