(defun fic-ao3 () "Format fic for posting to AO3 and export it" (interactive) (org-format) (save-buffer) (goto-char (point-min)) (while (re-search-forward "\\[fn:.*\\]" nil t) (replace-match "")) (let ((org-export-with-title 'nil) (org-export-with-author 'nil) (org-export-with-creator 'nil) (org-export-with-date 'nil) (org-export-with-section-numbers 'nil) (org-export-time-stamp-file 'nil) (org-export-with-toc 'nil) (org-html-validation-link 'nil)) (org-html-export-to-html)) (revert-buffer t t) (setq oldname (concat (file-name-base) ".org")) (setq newname (concat (file-name-base) ".html")) (find-file-noselect newname) (with-current-buffer newname (goto-char (point-min)) (setq delpoint-one (search-forward "
\n")) (delete-region (point-min) delpoint-one) (goto-char (point-max)) (setq delpoint-two (search-backward "")) (delete-region delpoint-two (point-max)) (goto-char (point-min)) (while (re-search-forward "" nil t)
(replace-match "\n "))
(goto-char (point-min))
(while (re-search-forward " " nil t)
(replace-match " "))
(goto-char (point-min))
(while (re-search-forward "
\n\n