Add dw draft function

master
trémeur 3 years ago
parent 445ce3d029
commit 351f65eae9

@ -1,3 +1,29 @@
(defun dwdraft ()
(interactive)
(let ((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))
(defvar oldname (concat (file-name-base) ".org"))
(defvar newname (concat (file-name-base) ".html"))
(find-file-noselect newname)
(with-current-buffer newname
(goto-line 1)
(delete-region (line-beginning-position) (line-end-position))
(goto-line 2)
(delete-region (line-beginning-position) (line-end-position))
(goto-line 3)
(delete-region (line-beginning-position) (line-end-position))
(write-file newname)
(kill-ring-save (point-min) (point-max)))
(kill-buffer newname)
(with-current-buffer oldname
(delete-file newname)))
(defun dwpost (psubject tags icon)
(interactive "MPost title (REQUIRED): \nMTags (comma-separated): \nMIcon: ")
(let ((org-export-with-author 'nil)

Loading…
Cancel
Save