このメモはhtmlをじかに書いているが、org-modeの方が何かと書きやすいので、org-modeで書いて、htmlにexportするようにした。
こういう | 表とか | が |
簡単に | 書ける | 。 |
ソースコードもきれいに書ける。
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; make_my_memo_org_file ;; (bind-key* "C-c C-," 'make_my_memo_org_file) (defun make_my_memo_org_file (arg) "mode for memoranda personalia" (interactive "P") (setq delay_hours 3) ; count as the same day until 'delay_hours' hours past midnight (if (not arg) (setq arg 0)) (setq filename (format "~/Dropbox/memo-local/memo%s.org" (format-time-string "%Y%m%d" (time-add (current-time) (- (* arg 60 60 24) (* 60 60 delay_hours)) ) ) ) ) (find-file filename) (when (file-exists-p filename) (end-of-buffer) (insert (format-time-string "# OPENED: %Y-%m-%d %H:%M:%S\n")) ) (unless (file-exists-p filename) (insert "# THIS FILE IS " filename "\n") (insert (format-time-string "# MADE at %Y-%m-%d %H:%M:%S\n")) (insert "\n- ") ) )
(defun my_close_org_memo() "insert time-stamp, export only body to html, and upload html file." (interactive) (setq html_file_name (concat (file-name-sans-extension (buffer-file-name)) ".html")) (end-of-buffer) (insert (format-time-string "# EXPORTED at %Y-%m-%d %H:%M:%S\n")) (org-html-export-to-html nil nil t t) (shell-command-to-string (mapconcat #'shell-quote-argument (list "rsync" "-auv" html_file_name "myusername@mydomain.ne.jp:www/") " ") ) )