Skip to content

Commit

Permalink
Make front matter variables "public"
Browse files Browse the repository at this point in the history
By removing the double hyphens, we indicate that these variables can be
relied upon by the user.  In other words: these are hidden customisation
options for those who want to maintain some Do-It-Yourself code.
  • Loading branch information
protesilaos committed Jun 11, 2022
1 parent 254a6cd commit 73dc07a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions denote.el
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ treatment)."
('toml (format "[%S]" (downcase keywords)))
(_ (downcase keywords))))))

(defvar denote--tml-front-matter
(defvar denote-tml-front-matter

This comment has been minimized.

Copy link
@kaushalmodi

kaushalmodi Jun 11, 2022

Contributor

Now that this variable is made public, can you please replace "tml" to "toml" for better searchability?

This comment has been minimized.

Copy link
@kaushalmodi

kaushalmodi Jun 11, 2022

Contributor

I believe it was a typo when you first added it, because YAML -> yaml and TOML -> toml. But now that it's a public variable, let's fix that as soon as possible :)

This comment has been minimized.

Copy link
@protesilaos

protesilaos Jun 11, 2022

Author Owner

Good catch! Done in commit 11be1d6,

This comment has been minimized.

Copy link
@kaushalmodi

kaushalmodi Jun 11, 2022

Contributor

👍

"+++
title = %S
date = %s
Expand All @@ -377,7 +377,7 @@ identifier = %S
+++\n\n"
"TOML front matter value for `format'.")

(defvar denote--yaml-front-matter
(defvar denote-yaml-front-matter
"---
title: %S
date: %s
Expand All @@ -386,15 +386,15 @@ identifier: %S
---\n\n"
"YAML front matter value for `format'.")

(defvar denote--text-front-matter
(defvar denote-text-front-matter
"title: %s
date: %s
tags: %s
identifier: %s
%s\n\n"
"Plain text front matter value for `format'.")

(defvar denote--org-front-matter
(defvar denote-org-front-matter
"#+title: %s
#+date: %s
#+filetags: %s
Expand All @@ -410,10 +410,10 @@ TITLE, DATE, KEYWORDS, FILENAME, ID are all strings which are
(let ((kw-space (denote--file-meta-keywords keywords))
(kw-toml (denote--file-meta-keywords keywords 'toml)))
(pcase denote-file-type
('markdown-toml (format denote--tml-front-matter title date kw-toml id))
('markdown-yaml (format denote--yaml-front-matter title date kw-space id))
('text (format denote--text-front-matter title date kw-space id (make-string 27 ?-)))
(_ (format denote--org-front-matter title date kw-space id)))))
('markdown-toml (format denote-tml-front-matter title date kw-toml id))
('markdown-yaml (format denote-yaml-front-matter title date kw-space id))
('text (format denote-text-front-matter title date kw-space id (make-string 27 ?-)))
(_ (format denote-org-front-matter title date kw-space id)))))

(defun denote--path (title keywords)
"Return path to new file with TITLE and KEYWORDS.
Expand Down

0 comments on commit 73dc07a

Please sign in to comment.