|
366 | 366 | ;; Journal Entries |
367 | 367 | (global-set-key (kbd "C-c d j") |
368 | 368 | #'denote-journal-extras-new-entry) |
| 369 | + ;; Publishing writing |
| 370 | + (defun denote-publishing-extras-new-microblog-entry (&optional date) |
| 371 | + "Create a new microblog entry. |
| 372 | +Set the title of the new entry according to the value of the user option |
| 373 | +`denote-journal-extras-title-format'. |
| 374 | +
|
| 375 | +With optional DATE as a prefix argument, prompt for a date. If |
| 376 | +`denote-date-prompt-use-org-read-date' is non-nil, use the Org |
| 377 | +date selection module. |
| 378 | +
|
| 379 | +When called from Lisp DATE is a string and has the same format as |
| 380 | +that covered in the documentation of the `denote' function. It |
| 381 | +is internally processed by `denote-parse-date'." |
| 382 | + (interactive (list (when current-prefix-arg (denote-date-prompt)))) |
| 383 | + (let ((internal-date (denote-parse-date date)) |
| 384 | + (denote-directory (file-name-as-directory (expand-file-name "published" denote-directory)))) |
| 385 | + (denote |
| 386 | + (denote-journal-extras-daily--title-format internal-date) |
| 387 | + '("draft" "microblog") |
| 388 | + nil nil date |
| 389 | + ;; See YASnippet |
| 390 | + "microblog"))) |
| 391 | + |
| 392 | + (defun denote-publishing-extras-new-blog-entry (&optional date) |
| 393 | + "Create a new blog entry. |
| 394 | +
|
| 395 | +With optional DATE as a prefix argument, prompt for a date. If |
| 396 | +`denote-date-prompt-use-org-read-date' is non-nil, use the Org |
| 397 | +date selection module. |
| 398 | +
|
| 399 | +When called from Lisp DATE is a string and has the same format as |
| 400 | +that covered in the documentation of the `denote' function. It |
| 401 | +is internally processed by `denote-parse-date'." |
| 402 | + (interactive (list (when current-prefix-arg (denote-date-prompt)))) |
| 403 | + (let ((internal-date (denote-parse-date date)) |
| 404 | + (denote-directory (file-name-as-directory (expand-file-name "published" denote-directory)))) |
| 405 | + (denote |
| 406 | + (denote-title-prompt) |
| 407 | + '("draft") |
| 408 | + nil nil date |
| 409 | + ;; See YASnippet |
| 410 | + "fullblog"))) |
| 411 | + |
| 412 | + (global-set-key (kbd "C-c d p m") |
| 413 | + #'denote-publishing-extras-new-microblog-entry) |
| 414 | + (global-set-key (kbd "C-c d p b") |
| 415 | + #'denote-publishing-extras-new-blog-entry) |
369 | 416 |
|
370 | 417 | ;; Renaming Files |
371 | 418 | (global-set-key (kbd "C-c d r") #'denote-rename-file) |
|
0 commit comments