Skip to content

Commit 78da35f

Browse files
committed
Create denote functions for writing blog and microblog entries
Use YASnippet to define what I want to capture in each of these cases.
1 parent bd6810a commit 78da35f

File tree

3 files changed

+105
-0
lines changed

3 files changed

+105
-0
lines changed

init-el-get.el

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,53 @@
366366
;; Journal Entries
367367
(global-set-key (kbd "C-c d j")
368368
#'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)
369416

370417
;; Renaming Files
371418
(global-set-key (kbd "C-c d r") #'denote-rename-file)

snippets/org-mode/fullblog

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# -*- mode: snippet -*-
2+
# name: fullblog
3+
# key: fullblog
4+
# --
5+
#+category: $3
6+
#+options: toc:nil
7+
#+og_image: assets/images/$1.jpg
8+
#+og_description: $2
9+
# #+export_file_name: $1
10+
11+
$0
12+
13+
#+TOC: headlines 1
14+
15+
* Meta Information: $1 :noexport:
16+
17+
Clock the writing time against this entry.
18+
19+
** Sketch / Outline of the post
20+
21+
** Links
22+
23+
1. Vedang.me website link, pubilshed at <date>: https://vedang.me/$1/
24+
2. Substack link if any, posted at <date>:
25+
3. Bitly link, created at <date>:
26+
4. Twitter Thread link, posted at <date>:
27+
5. Fosstodon link, posted at <date>:
28+
6. Buttondown, published at <date>:
29+
7. Linkedin link, posted at <date>:
30+
31+
** Linkedin Post
32+
33+
** Twitter Thread

snippets/org-mode/microblog

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# -*- mode: snippet -*-
2+
# name: microblog
3+
# key: microblog
4+
# --
5+
6+
$0
7+
8+
* Meta Information :noexport:
9+
10+
Posted to:
11+
- [ ] Fosstodon
12+
- [ ] Twitter
13+
- [ ] Linkedin
14+
- [ ] Substack Notes
15+
- [ ] Chaitimers Discord
16+
- [ ] Unravel Discord
17+
- [ ] TEO Discord
18+
- [ ] REPL Discord
19+
- [ ] Links blog
20+
- [ ] ELD Whatsapp Group
21+
- [ ] XShift Whatsapp Group
22+
- [ ] Recurse Whatsapp Group
23+
- [ ] Recurse Zulip
24+
- [ ] Clojure Slack
25+
- [ ] Nilenso Slack

0 commit comments

Comments
 (0)